使用Bicep设置Azure存储帐户挂载路径



以前,使用Azure CLI脚本,我有以下存储帐户配置:

az webapp config storage-account add 
--resource-group $resourceGroup 
--name $functionAppName 
--storage-type AzureFiles 
--share-name $shareName 
--custom-id $shareId 
--account-name $AZURE_STORAGE_ACCOUNT 
--mount-path $mountPath 

现在,我正试图用二头肌写这个,但我找不到mount-path的任何配置。有没有可能在二头肌文件中设置这个?

Web Apps - Update Azure Storage Accounts接受一个存储属性字典,所以类似的东西应该可以工作:

var webAppName = 'web app name'
var storageAccountName = 'storage account name'
var shareName = 'share name'
var mountPath = 'mount path'
resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' existing = {
name: storageAccountName
}
resource webApp 'Microsoft.Web/sites@2021-01-15' existing = {
name: webAppName
}
resource storageSetting 'Microsoft.Web/sites/config@2021-01-15' = {
name: 'azurestorageaccounts'
parent: webApp
properties: {
'${shareName}': {
type: 'AzureFiles'
shareName: shareName
mountPath: mountPath
accountName: storageAccount.name
accessKey: storageAccount.listKeys().keys[0].value
}
}
}

最新更新