Creating a Storage Account with an existing name in the same region with a different sku is throwing an incorrect sku error #27899
Labels
Azure CLI Team
The command of the issue is owned by Azure CLI team
bug
This issue requires a change to an existing behavior in the product in order to be resolved.
Storage
az storage
Milestone
Describe the bug
In a discussion with the customer, he identified that when creating a storage account as LRS, after that if he tries to create the same storage account again but with a different SKU he receives the error below, however, the error he should receive should be [The storage account named "storageaccountname" is already taken.]
When trying to create the same storage account again with the same name in the same region, just change the SKU:
ERROR: cli.azure.cli.core.azclierror: (InvalidValuesForRequestParameters) Values for request parameters are invalid: sku.
Code: InvalidValuesForRequestParameters
Message: Values for request parameters are invalid: sku.
When trying to create the same storage account again with the same name in another region and changing the SKU:
ERROR: cli.azure.cli.core.azclierror: (InvalidResourceLocation) The resource 'asuracetestcona' already exists in location 'westeurope' in resource group 'adossa-dev-rg'. A resource with the same name cannot be created in location 'northeurope'. Please select a new resource name.
Code: InvalidResourceLocation
Message: The resource 'asuracetestcona' already exists in location 'westeurope' in resource group 'adosa-dev-rg'. A resource with the same name cannot be created in location 'northeurope'. Please select a new resource name.
All this behavior is possible and easy to reproduce (tested from my end and the same behavior) and is only reproducible with CLI, PowerShell correctly shows that correct error even changing the region of the account: The storage account named "storageaccountname" is already taken.
The customer is using cloud shell but I tried outside of cloud shell and we have the same behavior, even after more than 24 times of creating the account it continues to report the same error of "Values for request parameters are invalid: sku."
Attached I leave some logs that I collected with the customer, however, the error is easily reproducible with CLI.
raised by @ebrandao
Related command
az storage account create
Errors
ERROR: cli.azure.cli.core.azclierror: (InvalidValuesForRequestParameters) Values for request parameters are invalid: sku.
Code: InvalidValuesForRequestParameters
Message: Values for request parameters are invalid: sku.
Issue script & Debug output
debug-cli storage creation (1).txt
Expected behavior
It should show an error like this ERROR: cli.azure.cli.core.azclierror: (InvalidResourceLocation) The resource 'asuracetestcona' already exists in location 'westeurope' in resource group 'adossa-dev-rg'. A resource with the same name cannot be created in location 'westeurope'. Please select a new resource name.
Code: DuplicateResourceName
Environment Summary
azure-cli 2.54.0
Additional context
No response
The text was updated successfully, but these errors were encountered: