Azure-pipelines-tasks: AzureRmWebAppDeployment: Web.config doesn't get transformed

Created on 22 May 2017  路  5Comments  路  Source: microsoft/azure-pipelines-tasks

Hi!
I'm using the AzureRmWebAppDeployment task (version 3) and trying to transform my Web.config file. The task outputs that everything went fine ("XML Transformations applied successfully") but the Web.config still has the same values as the original. My setup is:

configtransforms

environments_vsts

And if I preview the transforms in visual studio everything looks good.
Also found a thread on the same topic here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/32b75db8-f6a5-4c5e-9e4e-251d01092b0b/deploy-azure-app-service-3-xml-transformation-does-not-transform-webconfig-on-release-vsts?forum=TFService

//Oskar

AzureAppService Release

Most helpful comment

@LarssonOskar,

If you are using MsDeploy Package for deployment, we have added some more guidance on how to get this working in new version of our task 3.3.6 which should reach to your account in a couple of weeks.

I am briefing the same here for you. Can you try these suggestions and let us know?

To Skip Applying Web.Production.Config on your Web.Config during Msbuild, you need to update your Web.Production.Config files

  1. Remove the <DependentUpon> tag for each config in the csproj file and rebuild.
  2. Ensure that the config file and transformation files are present in the same folder inside the package.

To Skip Overriding Connection String value, with default value in the package.

  1. ConnectionString attributes in Web.config is parameterized by default. Note that the transformation has no effect on connectionString attributes as the value is overridden during deployment by 'Parameters.xml or 'SetParameters.xml' files. You can disable the auto-parameterization by setting /p:AutoParameterizationWebConfigConnectionStrings=False during MSBuild package generation.

All 5 comments

@LarssonOskar,

If you are using MsDeploy Package for deployment, we have added some more guidance on how to get this working in new version of our task 3.3.6 which should reach to your account in a couple of weeks.

I am briefing the same here for you. Can you try these suggestions and let us know?

To Skip Applying Web.Production.Config on your Web.Config during Msbuild, you need to update your Web.Production.Config files

  1. Remove the <DependentUpon> tag for each config in the csproj file and rebuild.
  2. Ensure that the config file and transformation files are present in the same folder inside the package.

To Skip Overriding Connection String value, with default value in the package.

  1. ConnectionString attributes in Web.config is parameterized by default. Note that the transformation has no effect on connectionString attributes as the value is overridden during deployment by 'Parameters.xml or 'SetParameters.xml' files. You can disable the auto-parameterization by setting /p:AutoParameterizationWebConfigConnectionStrings=False during MSBuild package generation.

Hi @mvvsubbu and thanks for your reply!
Removing <DependentUpon> in the csproj file worked and the task now transforms the configs correctly! :+1:

Thanks for confirming I am going ahead and closing the issue

@mvvsubbu i have tried all to alternative solution that are explained here. but nothing worked for me and i get error Error: XML transformation error while transforming.

I moved my web.test.config tranformation file to the root to the web.config and then it worked. Thanks for this article.

Was this page helpful?
0 / 5 - 0 ratings