Azure
Azure Storage CLI
Azure Storage CLI commands for blob and file management.
28 commands
Windows
MacOS
Linux
#storage
#cloud
Account Management
az storage account create -n mystorageacct -g myRG --sku Standard_LRS -l eastus # Create storage account
az storage account list -g myRG -o table # List storage accounts in resource group
az storage account show -n mystorageacct -g myRG # Show storage account details
az storage account keys list -n mystorageacct -g myRG -o table # List access keys
az storage account delete -n mystorageacct -g myRG --yes # Delete storage account
Blob Operations
az storage container create -n mycontainer --account-name mystorageacct # Create blob container
az storage blob upload -f ./file.txt -c mycontainer -n file.txt --account-name mystorageacct # Upload file to blob
az storage blob upload-batch -d mycontainer -s ./local-dir --account-name mystorageacct # Upload directory to blob
az storage blob list -c mycontainer --account-name mystorageacct -o table # List blobs in container
az storage blob download -c mycontainer -n file.txt -f ./downloaded.txt --account-name mystorageacct # Download blob
az storage blob delete -c mycontainer -n file.txt --account-name mystorageacct # Delete a blob
az storage blob copy start --source-uri https://src.blob.core.windows.net/c/f -c dest -n f --account-name mystorageacct # Copy blob from URL
File Share
az storage share create -n myshare --account-name mystorageacct --quota 100 # Create file share with 100GB quota
az storage file upload -s myshare --source ./file.txt --account-name mystorageacct # Upload file to share
az storage file list -s myshare --account-name mystorageacct -o table # List files in share
az storage file download -s myshare -p file.txt --dest ./file.txt --account-name mystorageacct # Download file from share
az storage directory create -s myshare -n mydir --account-name mystorageacct # Create directory in share
Table & Queue
az storage table create -n mytable --account-name mystorageacct # Create storage table
az storage table list --account-name mystorageacct -o table # List storage tables
az storage queue create -n myqueue --account-name mystorageacct # Create storage queue
az storage queue list --account-name mystorageacct -o table # List storage queues
az storage message put -q myqueue --content "hello" --account-name mystorageacct # Add message to queue
SAS Tokens
az storage container generate-sas -n mycontainer --permissions rwl --expiry 2025-12-31 --account-name mystorageacct # Generate container SAS token
az storage blob generate-sas -c mycontainer -n file.txt --permissions r --expiry 2025-12-31 --account-name mystorageacct # Generate blob SAS token
az storage account generate-sas --permissions rl --resource-types co --services b --expiry 2025-12-31 --account-name mystorageacct # Generate account SAS token
Quick Commands
Upload a file to blob storage
az storage blob upload -f ./file.txt -c mycontainer -n file.txt --account-name mystorageacct
Generate SAS token for blob container
az storage container generate-sas -n mycontainer --permissions rwl --expiry 2025-12-31 --account-name mystorageacct
List storage account access keys
az storage account keys list -n mystorageacct -g myRG -o table