I was not able to find a post that succinctly demonstrated this, so I wanted to share my solution here. I was trying to deploy a .NET Core web application with some app settings inside an ARM template. The app settings are contained as an object with nested properties, like so:
"AzureStorageConfig":{ "AccountName":"this-is-a-dummy-value", "AccountKey":"this-is-a-dummy-value", "ImageContainer":"this-is-a-dummy-value", "ThumbnailContainer":"this-is-a-dummy-value" }
Here is what that resource looks like, in my ARM template, paying attention to the highlighted settings:
{ "name":"appsettings", "type":"config", "apiVersion":"2018-11-01", "dependsOn":[ "[resourceId('Microsoft.Web/sites', variables('sites_sample_aspnet_name'))]", "[resourceId('Microsoft.Insights/components', variables('sample_aspnet_appinsights_name'))]" ], "properties":{ "AzureStorageConfig__AccountName":"[variables('storageAccount_name')]", "AzureStorageConfig__ImageContainer":"this-is-a-dummy-value", "AzureStorageConfig__ThumbnailContainer":"this-is-a-dummy-value", "AzureStorageConfig__AccountKey":"[concat('@Microsoft.KeyVault(SecretUri=', reference(resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvault_name'), parameters('keyvaultAccessKeySecretName'))).secretUriWithVersion,')')]", "APPINSIGHTS_INSTRUMENTATIONKEY":"[reference(resourceId('Microsoft.Insights/components', variables('sample_aspnet_appinsights_name')), '2014-04-01').InstrumentationKey]" } }
The double underscore value, indicates a nested property, while the prefix before the double underscore indicates the object name. Thus, the property “AccountName” on the object “AzureStorageConfig”, becomes AzureStorageConfig__AccountName in the ARM template.
Thanks for this. But How this will look like in Azure web app configuration. I can see this add like another appsettings config instead of separate section.