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

Set Azure Storage Account mount path with Bicep

以前,使用 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 的任何配置。有没有可能在二头肌文件中设置它?

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 storageSetting 'Microsoft.Web/sites/config@2021-01-15' = {
  name: '${webAppName}/azurestorageaccounts'
  properties: {
    '${shareName}': {
      type: 'AzureFiles'
      shareName: shareName
      mountPath: mountPath
      accountName: storageAccount.name      
      accessKey: listKeys(storageAccount.id, storageAccount.apiVersion).keys[0].value
    }
  }
}