Leo Varghese
Leo Varghese

Reputation: 175

How to automate XML transformation for web.config & connectionStrings.config files from Azure CICD pipeline?

I have a scenario where I need to perform XML Transformation for Web.config & ConnectionStrings.config files of my .Net MVC project. My requirement is to perform this from my Azure CICD pipeline.

I am using Azure web apps to host my web application. I cannot use the Azure Web App Deploy task, as am deploying the files using FTP upload.

I am looking for a solution where I can transform these configs directly on the web apps from the release pipeline.

In my case, we are setting up a sitecore platform and the infrastructure is provisioned based on an ARM template. After provisioning, a base web app gets created with all the connectionStrings and web configs prepopulated. And What i am trying is to transform these pre-populated config files at the time of release.

Thanks in Advance.

Upvotes: 0

Views: 601

Answers (1)

Leo Liu
Leo Liu

Reputation: 76670

How to automate XML transformation for web.config & connectionStrings.config files from Azure CICD pipeline?

If you cannot use the Azure Web App Deploy task, you can try to use the XDT Transform extension that can apply transform for config file.

So, you could get the related configure files in release artifact, then configure transform per to release environments.

On the other hand, you can replace the value in configure file through Replace Tokens task.

Hope this helps.

Upvotes: 2

Related Questions