azure-policy
azure-policy copied to clipboard
storage account failed to deploy
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
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.