I have the following code to create an Azure Function App with Bicep lang
resource webSite 'Microsoft.Web/sites@2022-03-01' = {
name: 'xxxxxx'
location: resourceGroup().location
kind: 'functionapp'
properties: {
serverFarmId: 'zzzzzz'
siteConfig: {
appSettings: [
// some values
]
}
}
}
Then I need to get the host keys like 'master' or 'default' key
I tried some options like
resource functionApp 'Microsoft.Web/sites/functions@2022-03-01' existing = { name: 'xxxxxx' }
output key string = functionApp.listkeys().properties.masterKey
or
output key string = listKeys(resourceId('Microsoft.Web/sites/host', 'xxxxxx', 'default'), '2022-03-01').masterKey
But I allways receive an error from Azure with this message Encountered an error (BadGateway) from host runtime.
There are a way to get the keys easily?
To get the keys do I need to deploy a function inside my Function App?