How to assign app settings from an output variable #5502
-
Using this bicep, i'm trying to change the app settings based on an output variable using a union. What is the best way to achieve this? The a2 variable created below param serverfarms_externalid string
param slotname string
param http20enabled bool = false
param use32bit bool = true
param usewebsockets bool = true
param appservicename string
param appplanname string
param locationname string
param appsettingtypes object
resource web 'Microsoft.Web/sites/slots/config@2021-02-01' = {
parent: slot
name: 'web'
location: locationname
properties: {
numberOfWorkers: 1
defaultDocuments: [
'Default.htm'
'Default.html'
'Default.asp'
'index.htm'
'index.html'
'iisstart.htm'
'default.aspx'
'index.php'
'hostingstart.html'
]
appSettings: a2
}
}
resource hostname 'Microsoft.Web/sites/slots/hostNameBindings@2021-02-01' = {
parent: slot
name: '${appservicename}-${slotname}.azurewebsites.net'
location: locationname
properties: {
siteName: '${appservicename}/${slotname}'
hostNameType: 'Verified'
}
}
resource webSlotConfig 'Microsoft.Web/sites/slots/config@2021-02-01' existing = {
name: '${appservicename}/${slotname}/appsettings'
}
output config object = webSlotConfig.list()
output properties2 object = webSlotConfig.list().properties
output appInsightsKey string = webSlotConfig.list().properties2['APPINSIGHTS_INSTRUMENTATIONKEY']
output a2 array = union(items(webSlotConfig.list().properties2), items(appsettingtypes)) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Here is a sample of doing this: These all leverage the same Module in the same ways... https://github.com/brwilkinson/AzureDeploymentFramework/blob/main/ADF/bicep/AppServiceFunction.bicep#L92 |
Beta Was this translation helpful? Give feedback.
Here is a sample of doing this:
These all leverage the same Module in the same ways...
https://github.com/brwilkinson/AzureDeploymentFramework/blob/main/ADF/bicep/AppServiceFunction.bicep#L92
https://github.com/brwilkinson/AzureDeploymentFramework/blob/main/ADF/bicep/AppServiceWebSite.bicep
https://github.com/brwilkinson/AzureDeploymentFramework/blob/main/ADF/bicep/AppServiceContainer.bicep