Azure Storage Account

Overview


Key Features


Workflow

     +--------------------+
     | User / Application |
     +--------------------+
             |
             v
  +-------------------------+
  |  Azure Storage Account  |
  +-------------------------+
    |      |      |      |
    |      |      |      +---> [ Blob Storage ] (Objects/Files)
    |      |      |
    |      |      +----------> [ File Storage ] (SMB Shares)
    |      |
    |      +-----------------> [ Queue Storage ] (Messaging)
    |
    +------------------------> [ Table Storage ] (NoSQL)
    |
    +------------------------> [ Managed Disks ] (VM Storage)

Common Use Cases


Steps to Manage Storage Account using Azure CLI

1. Login to Azure

az login

2. Create a Resource Group (if not exists)

az group create --name MyResourceGroup --location eastus

3. Create a Storage Account

az storage account create \
  --name mystorageacct123 \
  --resource-group MyResourceGroup \
  --location eastus \
  --sku Standard_LRS \
  --kind StorageV2

4. List Storage Accounts

az storage account list -o table

5. Get Storage Account Keys

az storage account keys list \
  --resource-group MyResourceGroup \
  --account-name mystorageacct123

6. Create a Blob Container

az storage container create \
  --name mycontainer \
  --account-name mystorageacct123

7. Upload a File to Blob

az storage blob upload \
  --container-name mycontainer \
  --file ./localfile.txt \
  --name remotefile.txt \
  --account-name mystorageacct123

8. Download a Blob

az storage blob download \
  --container-name mycontainer \
  --name remotefile.txt \
  --file ./downloadedfile.txt \
  --account-name mystorageacct123

9. Delete Storage Account (Caution!)

az storage account delete --name mystorageacct123 --resource-group MyResourceGroup --yes

Notes