Search code examples
azureazure-service-fabricazure-pipelines-release-pipelineapplication-settings

How to update setting.xml files sections in Service fabric cluster from azure pipeline while deployment


I am trying to create multiple environments. While deploying fabric, I need to update settings such as connection string, external resource names based on the environment on which I am deploying fabric code. I am using "Service Fabric application deployment Task" of azure pipeline for code deployment. I know in case of web app we can configure in "Azure App Service deploy" tasks' "Application and Configuration settings" but in case of fabric deploy there is relative fields How can I updated settings.xml file to reflect environment specific settings ?


Solution

  • There isn't a task can automatically change the settings.xml file. However, you can update the settings.xml file by File Transform task or Replace Token task.

    Both tasks can do XML Transformation and XML variable substitution.

    Replace Token task is a third-party open source extension authored by Guillaume Rouchon. You need to download it, and it can be found as a built-in task template.

    For File Transform task, you can click this document for detailed steps and examples.