Storage Account
Introduction
Section titled “Introduction”An Azure storage account serves as a centralized container for all your data objects, including blobs, files, queues, and tables. It provides a unique, globally accessible namespace reachable via HTTP or HTTPS. For more information, see Overview of storage accounts.
LocalStack for Azure provides a local environment for building and testing applications that make use of blobs, queues, and tables. For more information, see:
The supported APIs are available on our API Coverage section, which provides information on the extent of Storage Account’s integration with LocalStack.
Getting started
Section titled “Getting started”This guide is designed for users new to Azure Storage Accounts and assumes basic knowledge of the Azure CLI and our azlocal wrapper script.
Launch LocalStack using your preferred method. For more information, see Introduction to LocalStack for Azure. Once the container is running, enable Azure CLI interception by running:
azlocal start-interceptionThis command points the az CLI away from the public Azure management REST API and toward the LocalStack for Azure emulator API.
To revert this configuration, run:
azlocal stop-interceptionThis reconfigures the az CLI to send commands to the official Azure management REST API.
Create a resource group
Section titled “Create a resource group”Create a resource group for your storage account resources:
az group create \ --name rg-storage-demo \ --location westeurope{ "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-storage-demo", "location": "westeurope", "managedBy": null, "name": "rg-storage-demo", "properties": { "provisioningState": "Succeeded" }, "tags": null, "type": "Microsoft.Resources/resourceGroups"}Create a storage account
Section titled “Create a storage account”Create a storage account with the StorageV2 kind and Standard_LRS SKU:
az storage account create \ --name stordoc86acct \ --resource-group rg-storage-demo \ --location westeurope \ --sku Standard_LRS \ --kind StorageV2{ ... "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-storage-demo/providers/Microsoft.Storage/storageAccounts/stordoc86acct", ... "kind": "StorageV2", "location": "westeurope", "name": "stordoc86acct", ... "primaryEndpoints": { "blob": "https://stordoc86acct.blob.core.azure.localhost.localstack.cloud:4566", "queue": "https://stordoc86acct.queue.core.azure.localhost.localstack.cloud:4566", "table": "https://stordoc86acct.table.core.azure.localhost.localstack.cloud:4566", ... }, "provisioningState": "Succeeded", ...}Authentication
Section titled “Authentication”There are three ways to authenticate storage commands against the emulator:
Storage account key
Section titled “Storage account key”Retrieve the account key and pass it with --account-name and --account-key:
ACCOUNT_KEY=$(az storage account keys list \ --account-name stordoc86acct \ --resource-group rg-storage-demo \ --query "[0].value" \ --output tsv)
az storage container list \ --account-name stordoc86acct \ --account-key "$ACCOUNT_KEY"Login credentials
Section titled “Login credentials”Use --auth-mode login to authenticate with the current session credentials:
az storage container list \ --account-name stordoc86acct \ --auth-mode loginConnection string
Section titled “Connection string”Bundle the account name and key into a single value:
CONNECTION_STRING=$(az storage account show-connection-string \ --name stordoc86acct \ --resource-group rg-storage-demo \ --query connectionString -o tsv)
az storage container list \ --connection-string "$CONNECTION_STRING"The remaining examples in this guide use connection strings for brevity.
Manage account keys and connection string
Section titled “Manage account keys and connection string”List the storage account access keys:
az storage account keys list \ --account-name stordoc86acct \ --resource-group rg-storage-demo[ { "keyName": "key1", "permissions": "FULL", "value": "MWFjYTgyZjgtYzU0My00NjE0LThmZDctNzlkODg5ZjU4ZTE5", "..." }, { "keyName": "key2", "permissions": "FULL", "value": "NzliNzVhN2EtYTcwZC00ZTg4LWJkMTQtYjg4MWNlMDJjZDcx", "..." }]Regenerate the primary key:
az storage account keys renew \ --account-name stordoc86acct \ --resource-group rg-storage-demo \ --key key1Fetch a connection string for data-plane operations:
az storage account show-connection-string \ --name stordoc86acct \ --resource-group rg-storage-demo{ "connectionString": "DefaultEndpointsProtocol=https;EndpointSuffix=core.azure.localhost.localstack.cloud:4566;AccountName=stordoc86acct;AccountKey=YWQ5Y2Q2NDYtZTJmOC00ZjU3LWFmOTEtNzk5MjAxNzE1OWQx;BlobEndpoint=https://stordoc86acct.blob.core.azure.localhost.localstack.cloud:4566;FileEndpoint=https://stordoc86acct.file.core.azure.localhost.localstack.cloud:4566;QueueEndpoint=https://stordoc86acct.queue.core.azure.localhost.localstack.cloud:4566;TableEndpoint=https://stordoc86acct.table.core.azure.localhost.localstack.cloud:4566"}Features
Section titled “Features”The Storage Account emulator supports the following features:
- Control plane REST API: Storage account CRUD (create, read, update, delete, list), account key management, and name availability checks via Azure Resource Manager.
- Multiple authentication modes: Storage account key, login credentials, and connection strings.
- Storage account management: Create, update, delete, and list storage accounts. Supports
StorageV2,BlobStorage, andStorageaccount kinds with configurable SKU, access tier, and TLS version. - Account key management: List and regenerate storage account keys (
key1/key2). - Connection string generation: Retrieve ready-to-use connection strings containing all service endpoints (Blob, Queue, Table, File).
Limitations
Section titled “Limitations”- Header validation: Unsupported request headers or parameters are silently accepted instead of being rejected.
- API version enforcement: The emulator does not validate the
x-ms-versionheader; all API versions are accepted.
Samples
Section titled “Samples”The following samples demonstrate how to use Storage Accounts with LocalStack for Azure:
- Azure Functions Sample with LocalStack for Azure
- Azure Functions App with Managed Identity
- Azure Web App with Managed Identity
API Coverage
Section titled “API Coverage”| Operation ▲ | Implemented ▼ |
|---|