az storage account

Manage Azure Storage accounts.

Commands

Name Description Type Status
az storage account create

Create a storage account.

Core Preview
az storage account delete

Delete a storage account.

Core Preview
az storage account list

List storage accounts.

Core Preview
az storage account show

Show the properties of a storage account.

Core Preview

az storage account create

Preview

Create a storage account.

Create an Azure Storage account in the specified resource group. The account name and resource group are required; location defaults to the resource group location, SKU defaults to Standard_RAGRS, and kind defaults to StorageV2. The account name must be 3-24 characters using lower-case letters and numbers only and must be globally unique. Optional settings cover access tiers, TLS and public access, hierarchical namespace, SFTP and NFS, network rules, customer-managed encryption keys, managed identities, Azure Files identity-based authentication, SAS and key policies, and account-level immutability. Options that are not supplied are omitted from the request so the service default applies. The command waits for the long-running create operation to finish and returns the created account.

az storage account create --name
                          --resource-group
                          [--access-tier {Hot, Cool, Premium, Cold, Smart}]
                          [--account-type {User, Computer}]
                          [--action {Allow}]
                          [--allow-blob-public-access {true, false}]
                          [--allow-cross-tenant-replication {true, false}]
                          [--allow-protected-append-writes {true, false}]
                          [--allow-shared-key-access {true, false}]
                          [--allowed-copy-scope {PrivateLink, AAD, All}]
                          [--azure-storage-sid]
                          [--bypass]
                          [--custom-domain]
                          [--default-action {Allow, Deny}]
                          [--default-share-permission {None, StorageFileDataSmbShareReader, StorageFileDataSmbShareContributor, StorageFileDataSmbShareElevatedContributor}]
                          [--default-to-oauth-authentication {true, false}]
                          [--dns-endpoint-type {Standard, AzureDnsZone}]
                          [--domain-guid]
                          [--domain-name]
                          [--domain-sid]
                          [--edge-zone]
                          [--enable-alw {true, false}]
                          [--enable-blob-geo-priority-replication {true, false}]
                          [--enable-extended-groups {true, false}]
                          [--enable-files-aadds {true, false}]
                          [--enable-files-aadkerb {true, false}]
                          [--enable-files-adds {true, false}]
                          [--enable-hierarchical-namespace {true, false}]
                          [--enable-large-file-share]
                          [--enable-local-user {true, false}]
                          [--enable-nfs-v3 {true, false}]
                          [--enable-sftp {true, false}]
                          [--enable-smb-oauth {true, false}]
                          [--encryption-key-name]
                          [--encryption-key-source {Microsoft.Storage, Microsoft.Keyvault}]
                          [--encryption-key-type-for-queue {Account, Service}]
                          [--encryption-key-type-for-table {Account, Service}]
                          [--encryption-key-vault]
                          [--encryption-key-version]
                          [--forest-name]
                          [--https-only {true, false}]
                          [--identity-type {None, SystemAssigned, UserAssigned, SystemAssigned,UserAssigned}]
                          [--immutability-period-since-creation-in-days]
                          [--immutability-policy-state {Unlocked, Locked, Disabled}]
                          [--ip-address]
                          [--ipv6-address]
                          [--key-expiration-period-in-days]
                          [--key-vault-federated-client-id]
                          [--key-vault-user-identity-id]
                          [--kind {Storage, StorageV2, BlobStorage, FileStorage, BlockBlobStorage}]
                          [--large-file-shares-state {Disabled, Enabled}]
                          [--location]
                          [--min-tls-version {TLS1_0, TLS1_1, TLS1_2, TLS1_3}]
                          [--net-bios-domain-name]
                          [--profile]
                          [--public-network-access {Enabled, Disabled, SecuredByPerimeter}]
                          [--publish-internet-endpoints {true, false}]
                          [--publish-ipv6-endpoint {true, false}]
                          [--publish-microsoft-endpoints {true, false}]
                          [--require-infrastructure-encryption {true, false}]
                          [--routing-choice {MicrosoftRouting, InternetRouting}]
                          [--sam-account-name]
                          [--sas-expiration-action {Log, Block}]
                          [--sas-expiration-period]
                          [--sku {Standard_LRS, Standard_GRS, Standard_RAGRS, Standard_ZRS, Premium_LRS, Premium_ZRS, Standard_GZRS, Standard_RAGZRS, StandardV2_LRS, StandardV2_GRS, StandardV2_ZRS, StandardV2_GZRS, PremiumV2_LRS, PremiumV2_ZRS}]
                          [--subnet]
                          [--subscription-id]
                          [--tags]
                          [--user-identity-id]
                          [--vnet-name]
                          [--zone-placement-policy {Any, None}]
                          [--zones]

Examples

Create a general-purpose v2 account

az storage account create --resource-group myResourceGroup --name mystorageaccount --location eastus --sku Standard_LRS --kind StorageV2

Create a hardened account

az storage account create --resource-group myResourceGroup --name mystorageaccount --location eastus --sku Standard_LRS --kind StorageV2 --min-tls-version TLS1_2 --allow-blob-public-access false --allow-shared-key-access false --https-only true

Create an account restricted to specific networks

az storage account create --resource-group myResourceGroup --name mystorageaccount --location eastus --sku Standard_LRS --kind StorageV2 --default-action Deny --bypass AzureServices --ip-address 13.64.0.0/16 --subnet mySubnet --vnet-name myVnet

Create a Data Lake Storage Gen2 account with SFTP

az storage account create --resource-group myResourceGroup --name mystorageaccount --location eastus --sku Standard_LRS --kind StorageV2 --enable-hierarchical-namespace true --enable-sftp true

Create an account with a customer-managed key

az storage account create --resource-group myResourceGroup --name mystorageaccount --location eastus --sku Standard_LRS --kind StorageV2 --identity-type SystemAssigned --encryption-key-vault https://myvault.vault.azure.net/ --encryption-key-name mykey

Create an account with tags

az storage account create --resource-group myResourceGroup --name mystorageaccount --location eastus --sku Standard_LRS --kind StorageV2 --tags env=dev owner=platform

Required Parameters

--name -n

The name of the storage account. Must be between 3 and 24 characters in length and use numbers and lower-case letters only.

--resource-group -g

The resource group name.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--access-tier

The access tier used for billing. Required when kind is BlobStorage.

Property Value
Accepted values: Hot, Cool, Premium, Cold, Smart
--account-type

The Active Directory account type for Azure Storage.

Property Value
Accepted values: User, Computer
--action

The action applied to the subnet and IP rules. Defaults to Allow.

Property Value
Accepted values: Allow
--allow-blob-public-access

Allow or disallow public access to all blobs or containers. The service default is false.

Property Value
Accepted values: true, false
--allow-cross-tenant-replication

Allow or disallow cross AAD tenant object replication. The service default is false.

Property Value
Accepted values: true, false
--allow-protected-append-writes

Allow new blocks to be written to an append blob while maintaining immutability protection. Requires --enable-alw true.

Property Value
Accepted values: true, false
--allow-shared-key-access

Whether the account permits requests authorized with the account access key. The service default is true.

Property Value
Accepted values: true, false
--allowed-copy-scope

Restrict copy to and from storage accounts within an AAD tenant or with private links to the same VNet.

Property Value
Accepted values: PrivateLink, AAD, All
--azure-storage-sid

The security identifier (SID) for Azure Storage.

--bypass

Traffic to bypass the network rules (space-separated): None, Logging, Metrics, AzureServices. Requires --default-action.

--custom-domain

The custom domain name assigned to the account. Name is the CNAME source.

--default-action

The action to apply when no network rule matches. Required when any other network rule flag is used.

Property Value
Accepted values: Allow, Deny
--default-share-permission

The default share permission for users using Kerberos authentication when no RBAC role is assigned.

Property Value
Accepted values: None, StorageFileDataSmbShareReader, StorageFileDataSmbShareContributor, StorageFileDataSmbShareElevatedContributor
--default-to-oauth-authentication

Whether the default authentication is OAuth. The service default is false.

Property Value
Accepted values: true, false
--dns-endpoint-type

The type of endpoint. AzureDnsZone allows creating a large number of accounts in a single subscription.

Property Value
Accepted values: Standard, AzureDnsZone
--domain-guid

The domain GUID.

--domain-name

The primary domain the AD DNS server is authoritative for.

--domain-sid

The security identifier (SID) of the AD domain.

--edge-zone

The name of the edge zone to create the account in.

--enable-alw

Enable account-level immutability. Can only be set at creation time.

Property Value
Accepted values: true, false
--enable-blob-geo-priority-replication

Whether Blob Geo Priority Replication is enabled for the account.

Property Value
Accepted values: true, false
--enable-extended-groups

Enable extended group support with the local users feature.

Property Value
Accepted values: true, false
--enable-files-aadds

Enable Microsoft Entra Domain Services authentication for Azure Files.

Property Value
Accepted values: true, false
--enable-files-aadkerb

Enable Microsoft Entra Kerberos authentication for Azure Files.

Property Value
Accepted values: true, false
--enable-files-adds

Enable Active Directory Domain Services authentication for Azure Files. Requires all Active Directory properties.

Property Value
Accepted values: true, false
--enable-hierarchical-namespace

Enable a hierarchical namespace (Azure Data Lake Storage Gen2).

Property Value
Accepted values: true, false
--enable-large-file-share

Enable large file shares. Cannot be disabled once enabled.

--enable-local-user

Enable the local users feature.

Property Value
Accepted values: true, false
--enable-nfs-v3

Enable NFS 3.0 protocol support.

Property Value
Accepted values: true, false
--enable-sftp

Enable Secure File Transfer Protocol.

Property Value
Accepted values: true, false
--enable-smb-oauth

Whether managed identities can access SMB shares using OAuth.

Property Value
Accepted values: true, false
--encryption-key-name

The name of the key vault key. Must be given together with --encryption-key-vault.

--encryption-key-source

The encryption key source. Inferred as Microsoft.Keyvault when key vault options are supplied.

Property Value
Accepted values: Microsoft.Storage, Microsoft.Keyvault
--encryption-key-type-for-queue

The encryption key type for the Queue service.

Property Value
Accepted values: Account, Service
--encryption-key-type-for-table

The encryption key type for the Table service.

Property Value
Accepted values: Account, Service
--encryption-key-vault

The URI of the key vault. Must be given together with --encryption-key-name.

--encryption-key-version

The version of the key vault key. Opts out of implicit key rotation.

--forest-name

The Active Directory forest to get.

--https-only

Allow https traffic only to the storage service. The service default is true.

Property Value
Accepted values: true, false
--identity-type

The managed identity type for the account.

Property Value
Accepted values: None, SystemAssigned, UserAssigned, SystemAssigned,UserAssigned
--immutability-period-since-creation-in-days

The immutability period for blobs since policy creation, in days (1-146000). Requires --enable-alw true.

--immutability-policy-state

The mode of the account-level immutability policy. Requires --enable-alw true.

Property Value
Accepted values: Unlocked, Locked, Disabled
--ip-address

IPv4 addresses or CIDR ranges to allow (space-separated). Requires --default-action.

--ipv6-address

IPv6 addresses or CIDR ranges to allow (space-separated). Requires --default-action.

--key-expiration-period-in-days

Expiration period in days of the key policy assigned to the account.

--key-vault-federated-client-id

Client id of the multi-tenant application used for cross-tenant customer-managed-key encryption.

--key-vault-user-identity-id

Resource id of the user-assigned identity used for server-side encryption.

--kind

The type of storage account. Defaults to StorageV2.

Property Value
Accepted values: Storage, StorageV2, BlobStorage, FileStorage, BlockBlobStorage
--large-file-shares-state

Allow large file shares. Cannot be disabled once enabled.

Property Value
Accepted values: Disabled, Enabled
--location -l

The Azure region in which to create the storage account. Defaults to the resource group location.

--min-tls-version

The minimum TLS version permitted on requests to storage. The service default is TLS1_0.

Property Value
Accepted values: TLS1_0, TLS1_1, TLS1_2, TLS1_3
--net-bios-domain-name

The NetBIOS domain name.

--profile

Use the named profile for this command (overrides the active profile).

--public-network-access

Allow, disallow, or let Network Security Perimeter configuration evaluate public network access.

Property Value
Accepted values: Enabled, Disabled, SecuredByPerimeter
--publish-internet-endpoints

Whether internet routing storage endpoints are published.

Property Value
Accepted values: true, false
--publish-ipv6-endpoint

Whether IPv6 storage endpoints are published.

Property Value
Accepted values: true, false
--publish-microsoft-endpoints

Whether Microsoft routing storage endpoints are published.

Property Value
Accepted values: true, false
--require-infrastructure-encryption

Whether the service applies a secondary layer of encryption with platform managed keys.

Property Value
Accepted values: true, false
--routing-choice

The kind of network routing used to deliver user data.

Property Value
Accepted values: MicrosoftRouting, InternetRouting
--sam-account-name

The Active Directory SAMAccountName for Azure Storage.

--sas-expiration-action

The action performed when the SAS expiration period is violated. Requires --sas-expiration-period. Defaults to Log.

Property Value
Accepted values: Log, Block
--sas-expiration-period

Expiration period of the SAS policy assigned to the account, in DD.HH:MM:SS form.

--sku

The SKU name of the storage account. Defaults to Standard_RAGRS.

Property Value
Accepted values: Standard_LRS, Standard_GRS, Standard_RAGRS, Standard_ZRS, Premium_LRS, Premium_ZRS, Standard_GZRS, Standard_RAGZRS, StandardV2_LRS, StandardV2_GRS, StandardV2_ZRS, StandardV2_GZRS, PremiumV2_LRS, PremiumV2_ZRS
--subnet

Name or resource id of a subnet. If a name is given, --vnet-name is required.

--subscription-id

Azure Subscription Id. Defaults to the subscription of the active profile.

--tags

Resource tags in KEY=VALUE form (space-separated).

--user-identity-id

The ARM resource identifier of the user-assigned identity. Only one is permitted.

--vnet-name

Name of the virtual network containing --subnet.

--zone-placement-policy

The availability zone pinning policy for the account.

Property Value
Accepted values: Any, None
--zones

The availability zones to pin the account to (space-separated).

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az storage account delete

Preview

Delete a storage account.

Delete an Azure Storage account and all of the data it contains. This cannot be undone. The command deletes immediately without prompting for confirmation, so there is no --yes option. The command returns no output on success.

az storage account delete --name
                          --resource-group
                          [--profile]
                          [--subscription-id]

Examples

Delete a storage account

az storage account delete --resource-group myResourceGroup --name mystorageaccount

Required Parameters

--name -n

The name of the storage account.

--resource-group -g

The resource group name.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--profile

Use the named profile for this command (overrides the active profile).

--subscription-id

Azure Subscription Id. Defaults to the subscription of the active profile.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az storage account list

Preview

List storage accounts.

List Azure Storage accounts. Supply --resource-group to list the accounts in one resource group, or omit it to list every storage account in the subscription. Results are returned as a flat array; paged responses from the service are followed automatically.

az storage account list [--profile]
                        [--resource-group]
                        [--subscription-id]

Examples

List every storage account in the subscription

az storage account list

List the storage accounts in a resource group

az storage account list --resource-group myResourceGroup

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--profile

Use the named profile for this command (overrides the active profile).

--resource-group -g

The resource group name. Omit to list every storage account in the subscription.

--subscription-id

Azure Subscription Id. Defaults to the subscription of the active profile.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az storage account show

Preview

Show the properties of a storage account.

Get the properties of an Azure Storage account, including its SKU, kind, location, endpoints, network rules, encryption settings, and provisioning state. Use --expand geoReplicationStats to include geo-replication status, which reports the replication state and whether the account can fail over.

az storage account show --name
                        --resource-group
                        [--expand {geoReplicationStats}]
                        [--profile]
                        [--subscription-id]

Examples

Show a storage account

az storage account show --resource-group myResourceGroup --name mystorageaccount

Show a storage account with geo-replication statistics

az storage account show --resource-group myResourceGroup --name mystorageaccount --expand geoReplicationStats

Required Parameters

--name -n

The name of the storage account.

--resource-group -g

The resource group name.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--expand

Additional properties to include in the response.

Property Value
Accepted values: geoReplicationStats
--profile

Use the named profile for this command (overrides the active profile).

--subscription-id

Azure Subscription Id. Defaults to the subscription of the active profile.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.