以前,使用 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 \
现在,我尝试用 Bicep 编写此内容,但找不到 mount-path
的任何配置。是否有可能在 Bicep 文件中设置它?
最佳答案
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
}
}
}
关于azure - 使用 Bicep 设置 Azure 存储帐户装载路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69145422/