az storage account create: Create a Storage Account
az storage account create provisions an Azure Storage account for blobs, files, queues, and tables.
Many pipelines need somewhere to drop build artifacts or Terraform state. A storage account is the first step, and its name must be globally unique.
What it does
az storage account create provisions a storage account in a resource group with the SKU and kind you choose. The name must be globally unique, 3 to 24 lowercase alphanumeric characters, because it forms part of a public hostname.
Common usage
az storage account create \
--resource-group rg-app --name stappci20260630 \
--sku Standard_LRS --kind StorageV2 \
--location eastus \
--allow-blob-public-access falseSubcommands and flags
| Flag | What it does |
|---|---|
| --name, -n | Globally unique account name (3-24 lowercase) |
| --resource-group, -g | Target resource group |
| --sku | Replication SKU, e.g. Standard_LRS |
| --kind | Account kind, e.g. StorageV2 |
| --location, -l | Azure region |
| --allow-blob-public-access | Allow or block anonymous blob access |
In CI
Because the name is global, derive it deterministically (prefix plus a short hash) so reruns are idempotent. Set --allow-blob-public-access false by default and grant access with RBAC. Use --query to read back the account id for downstream steps.
Common errors in CI
"The storage account named ... is already taken" means another tenant owns that global name; change it. "StorageAccountAlreadyExists" within your own subscription means a rerun; treat it as success. "The name is not valid" means uppercase, hyphens, or the wrong length. "AuthorizationFailed" means missing Contributor.