I have a question related to Configuring Azure function authentication using Arm or Bicep template.
When I use the portal to configure authentication for Azure function, a MICROSOFT_PROVIDER_AUTHENTICATION_SECRET gets created automatically in the config. However, when I use the Bicep template below, MICROSOFT_PROVIDER_AUTHENTICATION_SECRET does not get created.
I tried also "az webapp auth microsoft update" command from CLI and got the same result. Authentication config got created without MICROSOFT_PROVIDER_AUTHENTICATION_SECRET
param function1name string = 'testfunctionnum1'
param region string
param srv string = 'xxxxx'
resource site1 'Microsoft.Web/sites@2022-03-01' = {
name: function1name
kind: 'functionapp,linux'
location: region
identity:{
type: 'SystemAssigned'
}
properties: {
// name: function1name
scmSiteAlsoStopped: false
clientAffinityEnabled: false
clientCertEnabled: false
clientCertMode: 'Required'
hostNamesDisabled: false
containerSize: 1536
dailyMemoryTimeQuota: 0
httpsOnly: true
redundancyMode: 'None'
storageAccountRequired: false
keyVaultReferenceIdentity: 'SystemAssigned'
siteConfig: {
numberOfWorkers:1
linuxFxVersion:'Python|3.9'
acrUseManagedIdentityCreds: false
alwaysOn: false
http20Enabled: false
functionAppScaleLimit: 200
minimumElasticInstanceCount: 0
]
}
serverFarmId: srv
}
}
resource fn1config 'Microsoft.Web/sites/config@2022-03-01' = {
parent: site1
name: 'web'
properties:{
linuxFxVersion: 'PYTHON|3.9'
ftpsState: 'FtpsOnly'
}
}
resource fn1auth 'Microsoft.Web/sites/config@2022-03-01' = {
parent: site1
name: 'authsettingsV2'
properties:{
platform: {
enabled: true
}
globalValidation: {
requireAuthentication: true
unauthenticatedClientAction: 'Return401'
}
identityProviders:{
azureActiveDirectory:{
enabled: true
registration:{
clientId:'xxx'
clientSecretSettingName: 'MICROSOFT_PROVIDER_AUTHENTICATION_SECRET'
openIdIssuer: 'https://sts.windows.net/xxxx/v2.0'
}
// login:{
// disableWWWAuthenticate: false
// }
// isAutoProvisioned: false
}
}
login:{
tokenStore:{
enabled:true
}
}
}
}