Storage Account BICEP Code:
param stAccName string
resource storageAcc 'Microsoft.Storage/storageAccounts@2023-05-01' = {
name: stAccName
location: resourceGroup().location
sku: {
name:'Standard_LRS'
}
kind: 'FileStorage'
}
PowerShell Command:
PS C:\Windows\System32> New-AzResourceGroupDeployment -Name 'FileStorageDeployment'
-TemplateFile 'D:\LearnBicep\demosettingdefaults.bicep' -ResourceGroupName 'vivekchak-rg'
-Mode Incremental
Error:
cmdlet New-AzResourceGroupDeployment at command pipeline position 1 Supply values for the following parameters: (Type !? for Help.) stAccName: staccvvkprcci01 New-AzResourceGroupDeployment: 4:21:36 PM - The deployment 'FileStorageDeployment' failed with error(s). Showing 1 out of 1 error(s). Status Message: Values for request parameters are invalid: kind, sku. For more information, see - https://aka.ms/storageaccounttypes (Code:InvalidValuesForRequestParameters)
CorrelationId:
DeploymentName : FileStorageDeployment
ResourceGroupName : vivekchak-rg
ProvisioningState : Failed
Timestamp : 12/29/2024 10:51:32 AM
Mode : Incremental
TemplateLink :
Parameters :
Name Type Value
=============== ========================= ==========
stAccName String "staccvvkprcci01"
Outputs :
DeploymentDebugLogLevel :
I've read the documentation but not sure why I'm getting error as I'm new to this Infrastructure as a code templates. Could anyone help me here where the code went wrong.
The deployment 'FileStorageDeployment' failed with error(s). Showing 1 out of 1 error(s). Status Message: Values for request parameters are invalid: kind, sku.
The above error occurred due to pass wrong sku in the bicep code.
According to this MS-Document,
FileStorage
accounts Supported values for the sku is either Premium_LRS
or Premium_ZRS
.
You need to change your sku
in your bicep code to Premium_LRS
Code:
param stAccName string
resource storageAcc 'Microsoft.Storage/storageAccounts@2023-05-01' = {
name: stAccName
location: resourceGroup().location
sku: {
name: 'Premium_LRS'
}
kind: 'FileStorage'
}
Output:
DeploymentName : FileStorageDeployment
ResourceGroupName : venkatesan-rg
ProvisioningState : Succeeded
Timestamp : 12/30/2024 4:28:42 AM
Mode : Incremental
TemplateLink :
Parameters :
Name Type Value
=============== ========================= ==========
stAccName String "venkat12309"
Outputs :
DeploymentDebugLogLevel :
Portal: