Appveyor deploy to Azure cloud service with Web.config transform

351 views Asked by At

How can I configure which Web.config to use in deployment to Azure Cloud Services?

I have two files (Web.config and Web.Staging.config) how can I configure to transform Web.config using Web.Staging.config?

I will change the question: in AppVeyor build and deploy process there is a command linke that:

"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" "C:\projects\xxxxxxxxx\xxxxxxxx.AzureCloudService\xxxxxxxxxxx.AzureCloudService.ccproj" /p:Configuration="**Release**" /p:Platform="AnyCPU" /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /t:Publish /p:PublishDir=C:\Users\appveyor\AppData\Local\Temp\1\th712xjsl2\

In that command, there is a parameter called Configuration that has a fixed "Release".
How can I change this parameter to another configuration?
Is there a way in AppVeyor settings or in Visual Studio?

1

There are 1 answers

0
Feodor Fitsner On

Web.config transformation is run at the time Azure cloud service package creation and is controlled by solution configuration.

However, you cannot choose between different web.configs during the deployment as cloud service package already contains transformed web.config.

This blog post describes a nice approach of how you can change Azure cloud service configs at the time of deployment: https://blogs.endjin.com/2015/03/using-a-different-new-relic-application-name-per-environment-with-azure-cloud-services/