You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何使用Bicep配置Azure存储帐户的mount-path挂载路径

Bicep配置存储挂载路径说明

可以在Bicep中配置mount-path对应的参数,该参数对应Bicep中App Service/函数应用存储挂载配置的mountPath属性,你可以通过Microsoft.Web/sites/config资源下的azurestorageaccounts配置项完成对应设置。

对应你给出的CLI命令,等效的Bicep配置片段参考如下:

// 提前定义的参数/变量示例(可根据你的实际场景调整)
param resourceGroup string
param functionAppName string
param shareName string
param shareId string
param AZURE_STORAGE_ACCOUNT string
param mountPath string

// 函数应用存储挂载配置资源
resource functionAppStorageMount 'Microsoft.Web/sites/config@2022-03-01' = {
  name: '${functionAppName}/azurestorageaccounts'
  properties: {
    // 对象键名对应CLI的--custom-id参数值
    '${shareId}': {
      type: 'AzureFiles' // 对应CLI的--storage-type参数
      shareName: shareName // 对应CLI的--share-name参数
      accountName: AZURE_STORAGE_ACCOUNT // 对应CLI的--account-name参数
      mountPath: mountPath // 对应CLI的--mount-path参数
      accessKey: listKeys(resourceId('Microsoft.Storage/storageAccounts', AZURE_STORAGE_ACCOUNT), '2022-09-01').keys[0].value
    }
  }
}

配置注意事项

  • 配置对象的外层键名必须和你CLI命令中传入的--custom-id取值一致,同个应用下的多个挂载配置id不可重复
  • mountPath的取值规则和Azure CLI要求完全一致:Windows环境路径必须以/开头,Linux环境路径不能以/home开头

内容的提问来源于stack exchange,提问作者Sergiu Molnar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.04 08:21:01