LinuxCommandLibrary

az-storage-account

Manage Azure storage accounts

TLDR

Create an storage account

$ az storage account create [[-n|--name]] [storage_account_name] [[-g|--resource-group]] [azure_resource_group] --location [azure_location] --sku [storage_account_sku]
copy

Generate a shared access signature for a specific storage account
$ az storage account generate-sas --account-name [storage_account_name] [[-n|--name]] [account_name] --permissions [sas_permissions] --expiry [expiry_date] --services [storage_services] --resource-types [resource_types]
copy

List storage accounts
$ az storage account list [[-g|--resource-group]] [azure_resource_group]
copy

Delete a specific storage account
$ az storage account delete [[-n|--name]] [storage_account_name] [[-g|--resource-group]] [azure_resource_group]
copy

SYNOPSIS

az storage account <command> [options]

PARAMETERS

--debug
    Increase logging verbosity to show all debug logs.

--help -h
    Show this help message and exit.

--only-show-errors
    Only show errors, suppressing warnings.

--output -o
    Output format: json, jsonc, table, tsv (default: json).

--query
    JMESPath query string to customize output.

--subscription
    Name or ID of subscription.

--verbose
    Increase logging verbosity.

DESCRIPTION

The az storage account command group provides tools to create, configure, update, and delete Azure Storage accounts from the command line. Azure Storage accounts serve as the fundamental unit for data storage in Azure, supporting blobs, files, queues, tables, and disks. They offer options for redundancy (LRS, GRS), performance tiers (Standard, Premium), access tiers (Hot, Cool, Archive), and advanced features like hierarchical namespace for Azure Data Lake Storage Gen2.

Common tasks include listing accounts, regenerating access keys, configuring network rules for firewalls/VNETs, setting up private endpoints, managing encryption (customer-managed keys), and monitoring usage/metrics. Requires az login and appropriate RBAC permissions like Storage Account Contributor. Supports JSON querying with --query and various output formats. Ideal for automation in scripts, CI/CD pipelines, and infrastructure as code workflows with ARM templates or Terraform.

CAVEATS

Requires Azure CLI installation and az login. Some operations need specific permissions (e.g., Owner role for create). Rate limits apply for key regeneration/listing. Not all features available in all regions/SKUs.

COMMON SUBCOMMANDS

create, delete, list, show, keys, update, network-rule, private-endpoint-connection

AUTHENTICATION

Uses Azure AD or storage account keys. Run az storage account keys list for key access.

HISTORY

Introduced in Azure CLI 2.0 (2017), evolved with Azure Storage features like ADLS Gen2 (2018), private links (2019), and customer-managed keys. Regularly updated in CLI releases.

SEE ALSO

az storage(1), az login(1), az account(1)

Copied to clipboard