App.Config Configuration Transforms - Azure Cloud Service

We have a worker role as part of a cloud service. We do app.ENV.config => app.config transformations and also do Octopus variable replacement. Update and transformation of our .cscfg files work perfectly.

We’ve run into a lot of issues with the update/transformations of our app.[env].config files.

Our first major issue was that the .config files weren’t found, so we changed the transformation paths to include the directory. Now our .config files are being found (huge step in the right direction) but we’re getting the following error:

Performing variable substitution on 'F:\Octopus Deploy\Home\Work\20160208182656-62\LocalContent\FactsFamilyUpdateProcessorWorker\approot\App.App0.config’
12:27:19Error
System.IndexOutOfRangeException: Index was outside the bounds of the array.
12:27:19Error
at Calamari.Integration.ConfigurationTransforms.XmlConfigTransformDefinition…ctor(String definition) in Y:\work\14ffc968155e4956\source\Calamari\Integration\ConfigurationTransforms\XmlConfigTransformDefinition.cs:line 15
12:27:19Error
at Calamari.Deployment.Conventions.ConfigurationTransformsConvention.<>c.b__6_2(String s) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Conventions\ConfigurationTransformsConvention.cs:line 116
12:27:19Error
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() 12:27:19Error at System.Collections.Generic.List1…ctor(IEnumerable1 collection) 12:27:19Error at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
12:27:19Error
at Calamari.Deployment.Conventions.ConfigurationTransformsConvention.Install(RunningDeployment deployment) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Conventions\ConfigurationTransformsConvention.cs:line 25
12:27:19Error
at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60
12:27:19Error
at Calamari.Deployment.ConventionProcessor.RunConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 28
12:27:19Error
Running rollback conventions…
12:27:19Error
System.IndexOutOfRangeException: Index was outside the bounds of the array.
12:27:19Error
at Calamari.Integration.ConfigurationTransforms.XmlConfigTransformDefinition…ctor(String definition) in Y:\work\14ffc968155e4956\source\Calamari\Integration\ConfigurationTransforms\XmlConfigTransformDefinition.cs:line 15
12:27:19Error
at Calamari.Deployment.Conventions.ConfigurationTransformsConvention.<>c.b__6_2(String s) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Conventions\ConfigurationTransformsConvention.cs:line 116
12:27:19Error
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() 12:27:19Error at System.Collections.Generic.List1…ctor(IEnumerable1 collection) 12:27:19Error at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
12:27:19Error
at Calamari.Deployment.Conventions.ConfigurationTransformsConvention.Install(RunningDeployment deployment) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Conventions\ConfigurationTransformsConvention.cs:line 25
12:27:19Error
at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60
12:27:19Error
at Calamari.Deployment.ConventionProcessor.RunConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 50
12:27:19Error
at Calamari.Azure.Commands.DeployAzureCloudServiceCommand.Execute(String[] commandLineArguments) in Y:\work\14ffc968155e4956\source\Calamari.Azure\Commands\DeployAzureCloudServiceCommand.cs:line 97
12:27:19Error
at Calamari.Program.Execute(String[] args) in Y:\work\14ffc968155e4956\source\Calamari\Program.cs:line 38
12:27:19Fatal
The step failed: The remote script failed with exit code 100

Hi,

Thanks for reaching out. Could you please let me know which version of Octopus are you running and provide me with a Deployment log where I can see the full context of this failure? http://docs.octopusdeploy.com/display/OD/Get+the+raw+output+from+a+task

Regards,
Dalmiro

I’m not sure what the exact issue was - but I basically removed all my custom variable replacement and custom transforms. I’m putting Octopus variables in for all values I want to transform it’s working now.

Closing this discussion.