Appsettings not present after ARM deployment


BACK TO BLOG OVERVIEW


Within the config section of an App Service you are able to define multiple sections. In this example we are using three sections : web, appsettings and logs.

Since we noticed that sometimes the expected settings were not configured/missing after a deployment we figured out some missing dependsOn settings need to be set.

Please note that in the ARM snippet below the appsettings depend on the web settings to be processed. Subsequently the log settings depend on the appsettings to be processed.

After applying the additional rules we have not seen this behavior again.

Click ARM Snippet button to expand code:

[expander_maker id="1” more="ARM Snippet” less="Collapse”]

[php] { “name”: “[variables(‘ExampleAppName’)]”, “type”: “Microsoft.Web/sites”, “location”: “[resourceGroup().location]”, “apiVersion”: “2015-08-01”, “kind”: “api”, “dependsOn”: [ “[resourceId(‘Microsoft.Web/serverfarms’, variables(‘applicationPlanName’))]” ], “tags”: { “displayName”: “Example App” }, “properties”: { “name”: “[variables(‘ExampleAppName’)]”, “serverFarmId”: “[resourceId(‘Microsoft.Web/serverfarms/’, variables(‘applicationPlanName’))]”, “clientAffinityEnabled”: “false” }, “resources”: [{ “name”: “web”, “type”: “config”, “apiVersion”: “2015-08-01”, “dependsOn”: [ “[resourceId(‘Microsoft.Web/sites’, variables(‘ExampleAppName’))]” ], “tags”: { “displayName”: “webconfig Example App” }, “properties”: { “alwaysOn”: “true” } }, { “apiVersion”: “2015-08-01”, “name”: “appsettings”, “type”: “config”, “dependsOn”: [ “[resourceId(‘Microsoft.Web/sites’, variables(‘ExampleAppName’))]”, “[resourceId(‘Microsoft.Web/sites/config’, variables(‘ExampleAppName’), ‘web’)]” ], “tags”: { “displayName”: “appsettings Example App” }, “properties”: { “EXAMPLE1”: “[parameters(‘EXAMPLE1’)]”, “EXAMPLE2”: “[parameters(‘EXAMPLE2’)]” } }, { “name”: “logs”, “type”: “config”, “apiVersion”: “2015-08-01”, “dependsOn”: [ “[concat(‘Microsoft.Web/sites/’, variables(‘ExampleAppName’))]”, “[resourceId(‘Microsoft.Web/sites/config’, variables(‘ExampleAppName’), ‘appsettings’)]” ], “tags”: { “displayName”: “logs Example App” }, “properties”: { “applicationLogs”: { “fileSystem”: { “level”: “Warning” } }, “httpLogs”: { “fileSystem”: { “retentionInMb”: “35”, “enabled”: true } }, “detailedErrorMessages”: { “enabled”: false } } } ] } [/php]

[/expander_maker]