Azure Storage Documentation

Azure Storage – Introduction

Azure Storage provides massively scalable cloud storage for data objects, files, queues, and tables. It is designed for high availability, durability, and performance across a variety of workloads—from large-scale analytics to serving media content.

Table of Contents

Key Concepts

Getting Started

To start using Azure Storage:

  1. Create a Storage Account via the Azure portal, CLI, or ARM template.
  2. Choose the appropriate performance tier (Standard or Premium) and redundancy.
  3. Obtain the connection string or shared access signature (SAS) for authentication.
  4. Use one of the SDKs (e.g., .NET, Java, Python, JavaScript) to interact with the service.

Sample Code

Below is a minimal example in JavaScript (Node.js) that uploads a text file to a Blob container.


// Install: npm install @azure/storage-blob
const { BlobServiceClient } = require("@azure/storage-blob");
const fs = require("fs");
const connectionString = process.env.AZURE_STORAGE_CONNECTION_STRING;

async function uploadBlob() {
    const blobServiceClient = BlobServiceClient.fromConnectionString(connectionString);
    const containerName = "sample-container";
    const containerClient = blobServiceClient.getContainerClient(containerName);
    await containerClient.createIfNotExists();

    const blobName = "hello.txt";
    const blockBlobClient = containerClient.getBlockBlobClient(blobName);
    const data = "Hello, Azure Storage!";
    await blockBlobClient.upload(data, Buffer.byteLength(data));
    console.log(`Uploaded blob ${blobName} to container ${containerName}`);
}

uploadBlob().catch(console.error);

Best Practices

Further Reading