使用Bicep创建文件共享存储账户执行What-If时遇错误求助
部署Azure文件共享存储账户时What-If操作报错
我尝试部署一个基础文件共享存储账户(忽略注释行),通过流水线执行What-If操作时出现错误:
我已在参数文件中创建参数,并在Bicep文件顶部声明了对应正确数据类型的参数,但不清楚错误原因。以下为相关配置文件内容:
Bicep文件
//--Parameters--// @description('Specifies the location for resources.') param saLoc string @description('Optional. Type of Storage Account to create.') param saKind string // The below is optional - if you want to create a fileshare stoarge account with private endpoint, you might need to give the private ip of the private endpoint here // @description('Specifies the private IP Address of the Storage Account blob private endpoint.') // param saBlobPrivIp string = '' @description('Optional. Storage Account Sku Name.') @allowed([ 'Standard_LRS' 'Standard_GRS' 'Standard_RAGRS' 'Standard_ZRS' 'Premium_LRS' 'Premium_ZRS' 'Standard_GZRS' 'Standard_RAGZRS' ]) param saSkuName string param saShareQuota int @description('Specifies the storage account to create') param saName string @description('Tags for the storage account') param saTags object @description('Array of File Shares to create') param saFileShares array // The below parameter is optional - if you want to link subnet with privateendpoint // @description('Subnet to connect Storage Account Private Endpoints') // param saSubnet string // The below parameter is optional - if using identity-based authentication settings for Azure Files, then uncomment the below // @description('Optional. Provides the identity-based authentication settings for Azure Files.') // param saazureFilesIdentityBasedAuthentication object = {} //--Variables--// // Loading values from the JSON file directly, some below are optional - if using private dns zone and domain, add them in envconstants file and uncomment the below var targetEnv = loadJsonContent('../../envconstants.json', 'targetEnvironment') // var privDNSZoneId = loadJsonContent('../../envconstants.json', 'privDNSZoneId') // var domain = loadJsonContent('../../envconstants.json', 'domain') // Extracting specific values from the JSON, some below are optional - if using managed domain add that in stoarge account, add that in envconstants file and uncomment this // var privDnsZoneFileCore = privDNSZoneId.fileCore // var mgDomainGuid = domain.managedDomainGuid // var mgDomainName = domain.managedDomainName // Enable Private Endpoints, the below is optional - if using private endpoint in stoarge account, keep this to true // var deployStorageAccPrivateEndpoints = false //--Modules--// module storageAccount 'br/public:avm/res/storage/storage-account:0.12.0' = { name: saName scope: resourceGroup(targetEnv.subId, targetEnv.resourceGrp) params: { location: saLoc kind: saKind skuName: saSkuName // Required parameters name: toLower(saName) // Non-required parameters allowBlobPublicAccess: false publicNetworkAccess: 'Disabled' requireInfrastructureEncryption: true sasExpirationPeriod: '30.00:00:00' networkAcls: { bypass: 'AzureServices' defaultAction: 'Deny' } tags: saTags // azureFilesIdentityBasedAuthentication: !empty(saazureFilesIdentityBasedAuthentication) ? { // activeDirectoryProperties: { // domainGuid: mgDomainGuid // domainName: mgDomainName // } // defaultSharePermission: saazureFilesIdentityBasedAuthentication.defaultSharePermission // directoryServiceOptions: 'AADDS' // } : {} fileServices: !empty(saFileShares) ? { shareDeleteRetentionPolicy: { days: 7 enabled: true } shares: saFileShares shareQuota: saShareQuota tags: saTags } : {} // privateEndpoints: deployStorageAccPrivateEndpoints ? [ // !empty(saFilePrivIp) ? { // privateDnsZoneResourceIds: [ privDnsZoneFileCore ] // name: '${saName}-${saLoc}-file-pep' // service: 'file' // location: saLoc // subnetResourceId: saSubnet // customNetworkInterfaceName: '${saName}-${saLoc}-file-nic' // ipConfigurations: [ // { // name: '${saName}-file-ipconf' // properties: { // groupid: 'file' // membername: 'file' // privateIPAddress: saFilePrivIp // } // } // ] // tags: { // 'hidden-title': saName // } // } : { // privateDnsZoneResourceIds: [ privDnsZoneFileCore ] // name: '${saName}-${saLoc}-file-pep' // service: 'file' // location: saLoc // subnetResourceId: saSubnet // customNetworkInterfaceName: '${saName}-${saLoc}-file-nic' // tags: { // 'hidden-title': saName // } // } // ] : [] } }
bicepparam参数文件
param saName = 'testfileshare' param saLoc = 'South Central US' param saKind = 'StorageV2' param saShareQuota = 200 param saSkuName = 'Standard_LRS' param saFileShares = [{ name: 'default' }] param saTags = { environment: 'TEST-PERSONAL-REPO' created_by: 'bicep' }
内容的提问来源于stack exchange,提问作者wasim
相关产品推荐
相关产品推荐

