BlockBlob 存储二头肌代码:
@minLength(3)
@maxLength(24)
param storageAccName string = uniqueString(resourceGroup().id)
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' = {
name: storageAccName
location: resourceGroup().location
sku: {
name: 'Premium_LRS'
}
kind: 'BlockBlobStorage'
}
PowerShell 代码:
PS C:\Windows\System32> New-AzResourceGroupDeployment -Name 'BlockBlobStorageDeployment' -TemplateFile 'D:\LearnBicep\uniquestringdemo.bicep' -ResourceGroupName 'vivekchak-rg' -Mode Incremental
New-AzResourceGroupDeployment
:下午 5:01:43 - 部署“BlockBlobStorageDeployment”失败并出现错误。显示 1 个错误中的 1 个。
状态消息:请求参数的值无效:kind、sku。有关详细信息,请参阅 - https://aka.ms/storageaccounttypes(代码:InvalidValuesForRequestParameters)
相关 ID:
DeploymentName : BlockBlobStorageDeployment
ResourceGroupName : vivekchak-rg
ProvisioningState : Failed
Timestamp : 12/29/2024 11:31:39 AM
Mode : Incremental
TemplateLink :
Parameters :
Name Type Value
================ ========================= ==========
storageAccName String "rr5rrwknkv5nc"
Outputs :
DeploymentDebugLogLevel :
在部署
BlockBlobStorage
时,我也遇到上述错误。
问题发生在哪里?
使用 Premium_LRS 进行 BlockBlobStorage 时,部署“BlockBlobStorageDeployment”失败并出现错误
问题似乎在于将
Premium_LRS
与不支持的 BlockBlobStorage
类型一起使用。
对于上述类型,支持的 sku 是
Premium_ZRS
对于BlockBlobStorage
。
二头肌样本:
@minLength(3)
@maxLength(24)
param storageAccName string = uniqueString(resourceGroup().id)
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' = {
name: storageAccName
location: resourceGroup().location
sku: {
name: 'Premium_ZRS'
}
kind: 'BlockBlobStorage'
}
部署:
New-AzResourceGroupDeployment -Name 'BlockBlobStorageDeployment' -TemplateFile '/home/main.bicep' -ResourceGroupName 'vinay-rg' -Mode Incremental
参考: