azure-policy icon indicating copy to clipboard operation
azure-policy copied to clipboard

storage account failed to deploy

Open ptsouk opened this issue 4 years ago • 1 comments

Hello, I see an issue in the built-in policy Configure Synapse workspaces to have auditing enabled The template deployment of the storage account (generated name - in my deployment is: workspaceauditwess2khgm7u4h4og) fails with the following message:

{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"AccountNameInvalid","message":"workspaceauditwess2khgm7u4h4og is not a valid storage account name. Storage account name must be between 3 and 24 characters in length and use numbers and lower-case letters only."}]}

The line here should be: "storageName": "[take(tolower(concat('workspaceaudit', variables('locationCode'), variables('uniqueStorage'))), 24)]",

using take() will limit the length of the storage account name in order to successfully deploy - considering the resource name rule for the Microsoft.Storage/storageAccounts

ptsouk avatar Jul 26 '21 12:07 ptsouk

Hi @ptsouk, thank you for raising this issue. We have brought this to the attention of the team that owns this built-in policy to correct it.

shanhix1 avatar Feb 09 '22 18:02 shanhix1