Use an output variable with substitute variables in files

Hi there!

Our Azure App service is created via an ARM template. This template uses an output variable for the instrumentationkey of the App Insight component. This key we need to place in the appsettings.json file in the App service.
The output variable works perfect, but we want to use this variable with the substitution of variables in .config and .json files.

So before deploying the App Service the key has to be substituted in the appsettings.json.
is there a way to do this?



Hi Andre,

Thanks for getting in touch! I believe there is a way to achieve what you’re after, but let me check that I understand your deployment process correctly. In your process you have an initial step that uses an ARM template to create an Azure App service, and creates some output variables for later use. Do you then have a second step to deploy the app service, e.g. an Azure Web App, from a package? And that package contains the .config and .json files that need to use the output variables from the previous step?

If the above describes your scenario accurately then I believe enabling the JSON and Configuration variables features on the second step should be all you need.

If this doesn’t cover your scenario, would you be able to attach a screenshot of your project’s deployment process? Feel free to mark this discussion as private if there is anything sensitive in the content.


Hi Shannon,

You described my scenario perfectly, but I was searching for the way substitution of output variables work.

A colleague of me found the right article:

We had to enter the output variable in the json file just like the project variables.



Hi André,

Glad to hear you found a solution.

Happy Deployments!