Ayo Adesina
Ayo Adesina

Reputation: 2395

How to set environment variable in Azure for a App service

I have a .net Framework Web App running in Azure. In my code I have a line that gets an environment variable:

var x = System.Environment.GetEnvironmentVariable("MY_Setting_Name");

How do I set/view this setting in the Azure portal? is it the same place as app settings? becuase I thought that was for the settings in the web-config file.

Upvotes: 2

Views: 8162

Answers (1)

Thiago Custodio
Thiago Custodio

Reputation: 18387

Just go to Configuration -> Application settings and create key value pairs that will be read by your application.

enter image description here

enter image description here

More info: https://learn.microsoft.com/en-us/azure/app-service/configure-common#configure-app-settings

Upvotes: 5

Related Questions