Retrieving existing app center key #5413
-
In my bicep file I need to get the "APPINSIGHTS_INSTRUMENTATIONKEY" from the configuration. I'm new to biceps and i'm not sure how to reference this value and store in a variable. if I have "param AppInsightsId string" How can I reference that value to use in my bicep file? I tried this, but it's wrong |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Here are the docs for this: You can see the following: I would recommend to establish the
e.g. verbose and descriptiveparam siteName string = 'ACU1-BRW-AOA-T5-fnDIS01'
param slotName string = 'dev'
resource webSite 'Microsoft.Web/sites@2021-02-01' existing = {
name: siteName
}
resource webSlot 'Microsoft.Web/sites/slots@2021-02-01' existing = {
name: slotName
parent: webSite
}
resource webSlotConfig 'Microsoft.Web/sites/slots/config@2021-02-01' existing = {
name: 'appsettings'
parent: webSlot
}
output config object = webSlotConfig.list()
output properties object = webSlotConfig.list().properties
output appInsightsKey string = webSlotConfig.list().properties['APPINSIGHTS_INSTRUMENTATIONKEY']
output AppSettings array = items(webSlotConfig.list().properties) same again, terse versionparam siteName string = 'ACU1-BRW-AOA-T5-fnDIS01'
param slotName string = 'dev'
resource webSlotConfig 'Microsoft.Web/sites/slots/config@2021-02-01' existing = {
name: '${siteName}/${slotName}/appsettings'
}
output config object = webSlotConfig.list()
output properties object = webSlotConfig.list().properties
output appInsightsKey string = webSlotConfig.list().properties['APPINSIGHTS_INSTRUMENTATIONKEY']
output AppSettings array = items(webSlotConfig.list().properties) |
Beta Was this translation helpful? Give feedback.
Here are the docs for this:
https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-functions-resource#implementations
You can see the following:
I would recommend to establish the
existing
resource reference first, then you can use that to call the list() function.e.g.
verbose and descriptive