Dalmiro, these steps don’t appear to work as proposed.
I created a new AzureCloudService exactly as you have except instead of Web.Debug.Config, I had an additional Web.Azure.config. I then set that to ‘Copy Always’ so it would be copied to the projects bin folder on build.
I packaged the cloud service using Visual Studio’s Package… command. The package command dumps the cloud service package into a bin/Release/app.publish
folder, so using a nuspec with
<file src="bin\Release\app.publish\*.*" target="" />
I was able to generate a nuget package from the command line with nuget pack AzureCloudService.nuspec -Version 1.0.0
and upload that package to the Octopus nuget feed.
In Octopus I setup a project to deploy that using the Azure Cloud Service deployment step and enabled the Configuration Transformation feature. As per your suggestion I added an Additional Transform of:
#{Octopus.Action.Azure.PackageExtractionPath}\LocalContent\WebRole1\sitesroot\0\bin\web.Azure.config => #{Octopus.Action.Azure.PackageExtractionPath}\LocalContent\WebRole1\sitesroot\0\web.config
But no transformation takes place.
Note: My sample projects web.config transformation consists of a single appsetting:
<appSettings>
<add key="WhereDidIComeFrom" value="DefaultWebConfig" />
...
</appSettings>
with the config file looking like:
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add xdt:Transform="SetAttributes" xdt:Locator="Condition(@key='WhereDidIComeFrom'])" value="AzureConfig" />
</appSettings>
</configuration>
Even if I put in an invalid path such as
#{Octopus.Action.Azure.PackageExtractionPath}\I_DONT_EXIST\LocalContent\WebRole1\sitesroot\0\bin\web.Azure.config => #{Octopus.Action.Azure.PackageExtractionPath}\LocalContent\WebRole1\sitesroot\0\web.config
Octopus doesn’t complain or show any errors. It simply doesn’t do anything with custom transforms.
Am I doing something wrong here or is there an issue with Octopus transforming config transforms.