question

absolutealgorithm avatar image
0 Votes"
absolutealgorithm asked MOXiMOX-2301 commented

Set Environment Variables from code for a Azure Function.

Hello, we have azure function with same code deployed into multiple environments or multiple instances. we set the variables locally in local.settings.json and later edit them from the azure portal in the configuration tab. Now, I want to set these variables from the code just like how we do it for a web api or a web app using appsettings.development.json, appsettings.staging.json etc. Is this possible with azure functions?

dotnet-csharpazure-functions
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MOXiMOX-2301 avatar image
0 Votes"
MOXiMOX-2301 answered MOXiMOX-2301 commented

Hi
I would recommend using Azure Devops for build and release. Through the release pipeline you can set those variables and use the transform action which would adjust the variables depending on which stage environment you are targeting.

Mox

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Please accept my response as a solution if you find it helpful

0 Votes 0 ·