Azure app service settings from an ARM template

The first way to configure application settings as code is by specifying app settings as a resource in an ARM template. This should be specified as a nested resource. This can be done as shown in the following screenshot:

{
"name": "[concat(variables(‘websiteName’), ‘/appsettings’)]",
"type": "config",
"apiVersion": "2015-08-01",
"dependsOn": [
"[concat('Microsoft.Web/sites/', variables('webSiteName'))]"
],
"properties": {
"key1": " [listKeys(parameters('storagename'), '2018-02-01').keys[0].value]",
"key2": "value2"
}
}

The use of the listKeys function is especially useful in these scenarios. It allows for the direct copying of secrets from any service to the application settings without ever storing them in any intermediate solution. For secrets that do not come from Azure sources, template parameters should be used.

The configuration specified in the ARM template corresponds to the configuration of an App Service that can be found in the portal. These settings are used to override corresponding entries in the appsettings.json or appsettings.config files. Updating this configuration automatically reloads the application as well.

The downside of this approach is that secrets that are stored this way are readable through the Azure portal. Any user with read access to the app service can retrieve all secrets stored this way.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.233.41