How to replace Environment Variables of an Azure Function in Release Pipeline on VSTS

Viewed 906

I developed an Azure Function and I need to use the Build and Release Pipelines of VSTS (Azure DevOps) to do the CI/CD.

To be able to use the same Build in different environments, I am using Environment.GetEnvironmentVariable("MyVariable") to get the value of some variables.

I am able to configure those variables on the Application Settings of the Azure Function, and I am also able to use the VSTS release pipeline to replace those values on the Application Settings.

However, due to security reasons imposed by my client, I cannot have those variables available to be seen at the Application Settings.

So I need to, somehow, use the Build/Release pipeline to set the environment variables and not make them readable on the function resource at the Azure Portal.

What is the most elegant way to do it?

I am using Azure Functions 2.0

Thank you in advance.

0 Answers
Related