Azure Docs

Get Started with Azure Blob Storage

Azure Blob Storage is Microsoft's object storage solution for the cloud. Blob storage is optimized for storing massive amounts of unstructured data, such as text or binary data. This guide will walk you through the fundamental steps to get started with Azure Blob Storage, including creating a storage account, creating a container, and uploading your first blob.

1. Create an Azure Storage Account

A storage account is a unique namespace in Azure that provides access to Azure Storage data objects. All objects in Azure Storage are managed by a storage account. You can create a storage account using the Azure portal, Azure CLI, or PowerShell.

Using the Azure Portal:

  1. Sign in to the Azure portal.
  2. In the search bar, type "Storage accounts" and select it.
  3. Click "Create".
  4. Select your subscription and resource group.
  5. Enter a unique name for your storage account.
  6. Choose a region.
  7. Select the performance tier (Standard is recommended for most scenarios).
  8. For redundancy, choose "Locally-redundant storage (LRS)" for basic needs or "Geo-redundant storage (GRS)" for higher durability.
  9. Review and create the storage account.

Using Azure CLI:

az storage account create \
    --name mystorageaccountname \
    --resource-group myresourcegroup \
    --location westus \
    --sku Standard_LRS \
    --kind StorageV2

Replace mystorageaccountname and myresourcegroup with your desired names.

2. Create a Container

Blobs are stored in containers. A container is similar to a directory in a file system. You can create containers using the Azure portal, Azure CLI, or Azure Storage Explorer.

Using the Azure Portal:

  1. Navigate to your newly created storage account.
  2. Under "Data storage", select "Containers".
  3. Click "+ Container".
  4. Enter a name for your container (e.g., my-first-container).
  5. Choose a public access level (Private is the default and recommended for most scenarios).
  6. Click "Create".

Using Azure CLI:

az storage container create \
    --name my-first-container \
    --account-name mystorageaccountname \
    --auth-mode login

Replace my-first-container and mystorageaccountname.

3. Upload Your First Blob

Now that you have a storage account and a container, you can upload files (blobs) to it. You can upload various types of files, including images, documents, videos, and application data.

Using the Azure Portal:

  1. Navigate to your container.
  2. Click "Upload".
  3. Browse to select the file you want to upload.
  4. Optionally, you can set advanced options such as block blob type and metadata.
  5. Click "Upload".

Using Azure CLI:

az storage blob upload \
    --account-name mystorageaccountname \
    --container-name my-first-container \
    --name my-local-file.txt \
    --file /path/to/your/my-local-file.txt \
    --auth-mode login

Replace mystorageaccountname, my-first-container, and the file paths accordingly.

Next Steps

Congratulations! You've successfully created an Azure Storage account, a container, and uploaded your first blob. Here are some recommended next steps:

Learn More About Uploading Blobs