Get Started with Azure Blob Storage
Welcome to Azure Blob Storage! This guide will walk you through the fundamental steps to start using Blob Storage, from creating a storage account to uploading your first blob.
Prerequisites:
- An Azure subscription. If you don't have one, you can sign up for a free account.
- An Azure Storage account. You can create one via the Azure portal, Azure CLI, or PowerShell.
1. Create a Storage Account
A storage account provides a unique namespace in Azure for your data. All objects in Azure Storage are contained within a storage account.
Using the Azure Portal:
- Navigate to the Azure portal and sign in.
- In the portal menu, select Create a resource.
- Search for Storage account and select it.
- Click Create.
- Fill in the required fields:
- Subscription: Select your Azure subscription.
- Resource group: Create a new one or select an existing one.
- Storage account name: Choose a globally unique name (lowercase letters and numbers).
- Region: Select the desired Azure region.
- Performance: Choose Standard or Premium.
- Redundancy: Select a redundancy option (e.g., LRS, GRS).
- Click Review + create and then Create.
2. Understand Storage Concepts
Before you proceed, it's helpful to understand a few key concepts:
- Blob Container: A container organizes a set of blobs, similar to a folder in a file system.
- Blob: A blob (binary large object) is the simplest type of object. It can hold any amount of text or binary data.
- Access Tiers: Blob Storage offers different access tiers (Hot, Cool, Archive) to optimize costs based on how frequently data is accessed.
3. Upload Your First Blob
You can upload blobs using various methods. Here's a simple example using the Azure portal.
- Once your storage account is created, navigate to its resource page in the Azure portal.
- In the left-hand menu, under Data storage, select Containers.
- Click + Container.
- Enter a name for your container (e.g.,
myblobcontainer) and set the public access level (typically Private for most scenarios). - Click Create.
- Click on the container name you just created.
- Click the Upload button.
- Select the file you want to upload from your local machine.
- You can optionally specify blob name, access tier, and other advanced options.
- Click Upload.
Tip: For programmatic uploads, consider using the Azure Storage SDKs for your preferred programming language or the Azure CLI.
4. Accessing Your Blob
After uploading, you can access your blob through:
- Azure Portal: Navigate to your container and click on the blob name. You can download it or copy its URL.
- Azure Storage Explorer: A free, cross-platform GUI tool for managing Azure Storage resources.
- SDKs: Integrate blob access into your applications using SDKs for .NET, Java, Python, Node.js, and more.
- REST API: Interact directly with Blob Storage services using HTTP requests.
Example using Azure CLI:
Make sure you have the Azure CLI installed and logged in.
# Upload a file to a blob
az storage blob upload --account-name <YOUR_STORAGE_ACCOUNT_NAME> --container-name <YOUR_CONTAINER_NAME> --name <BLOB_NAME> --file <LOCAL_FILE_PATH> --auth-mode login
# Download a blob
az storage blob download --account-name <YOUR_STORAGE_ACCOUNT_NAME> --container-name <YOUR_CONTAINER_NAME> --name <BLOB_NAME> --file <LOCAL_DESTINATION_PATH> --auth-mode login
View All Blob Storage Topics