Skip to content
Latchkey

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

Terminal
az storage account create \
  --resource-group rg-app --name stappci20260630 \
  --sku Standard_LRS --kind StorageV2 \
  --location eastus \
  --allow-blob-public-access false

Subcommands and flags

FlagWhat it does
--name, -nGlobally unique account name (3-24 lowercase)
--resource-group, -gTarget resource group
--skuReplication SKU, e.g. Standard_LRS
--kindAccount kind, e.g. StorageV2
--location, -lAzure region
--allow-blob-public-accessAllow 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.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →