PowerShell Command:
New-AzResourceGroupDeployment -Name 'StAccDeployment' -TemplateFile '.CreateStorageAccount.bicep' -ResourceGroupName 'bicepworks' -Mode Incremental
CreateStorageAccount.bicep:
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' = {
name: 'rajstaccprc01'
location: 'centralindia'
sku: {
name: 'Standard_LRS'
}
kind: 'BlobStorage'
}
The above bicep template is a basic one. When I see some udemy course video, the tutor succeeded the provisioning of the storage account using above basic template.
I know the video is from long ago. So, Do I miss any parameters in the above bicep code.
Correct me where I missed the code:
Error details:
New-AzResourceGroupDeployment: 15:25:52 - Error: Code=InvalidTemplateDeployment; Message=The template deployment 'StAccDeployment' is not valid according to the validation procedure. The tracking id is 'fb97bd7c-328a5a3c995b'. See inner errors for details.
New-AzResourceGroupDeployment: 15:25:52 - Error: Code=PreflightValidationCheckFailed; Message=Preflight validation failed. Please refer to the details for the specific errors.
New-AzResourceGroupDeployment: 15:25:52 - Error: Code=MissingRequiredAccountProperty; Message=Account property accessTier is required for the request.
New-AzResourceGroupDeployment: The deployment validation failed
2
Answers
The error message says it all
Also the relevant MS docs for Microsoft.Storage storageAccounts 2023-05-01 state
Valid values are below. You can read about & choose the appropriate tier on the Access tiers for blob data docs page
So adding something like this should do it
As @jitter answered, if using
kind = BlobStorage
, the accessTier in properties is required. referenceTry to use
kind = 'StorageV2'
to make it easy if the kind not mandatory, v2 type is also recommanded.here is a sample reference