Configuration tab in Azure App Services

Alberto De Natale
3 min readMay 13, 2019

--

This article explores how is possible to configure connection string and settings straight from an Azure App Service.

There are two sections exposed under the tab Configuration of an Azure App Service and we will look at how to make the most out of them:

In order to do that, we will need to create a .NET Core empty web application, an App Service and an Azure SQL Server DB.

I created them in Azure under the same resource group called “appsettings”

I also deployed the existing web app

Configuration in ASP.NET Core 2.2

App configuration in ASP.NET Core is based on key-value pairs established by “configuration providers”.

Environment Variables

Environment variables starting with “ASPNETCORE_”, the most popular of which being “ASPNETCORE_ENVIRONMENT”, may be configured in Azure.

I created this simple razor page:

When firstly deployed on Azure, it displays nothing:

But after saving clicking “Save” on the Configuration tab the following will get displayed:

appsettings.json

After adding the following lines:

This is what’s displayed on Azure

Coming from the following “appsettings.json

By adding the following inside the Configuration tab:

This is what will be displayed:

Conclusion

Settings can easily be managed from Azure and this offers a valid alternative to use different “appsettings.*.json”.

--

--

Alberto De Natale
Alberto De Natale

Written by Alberto De Natale

Alberto De Natale is a passionate tech-enthusiast software developer.

No responses yet