Skip to main content

Creating Publicly Accessible Azure Blob Storage Using Azure CLI

Prerequisites

  • Install the Azure CLI
  • Sign in to Azure using:
  • Ensure you have the necessary permissions to create resources in Azure.

Step 1: Create a Resource Group

Replace:
  • <resource-group-name> with your desired resource group name
  • <location> with your preferred Azure region (e.g., eastus)

Step 2: Create a Storage Account

Replace:
  • <storage-account-name> with a unique name for your storage account.
  • --allow-blob-public-access true enables public access at the storage account level.

Step 3: Create a Blob Container with Public Access

Replace:
  • <container-name> with your desired container name.
  • --public-access blob allows anonymous read access to the blobs within the container.

Step 4: Upload a Blob to the Container

Replace:
  • <blob-name> with the desired name for your blob.
  • <file-path> with the path to the file you want to upload.

Step 5: Access the Blob Publicly

Once uploaded, your blob will be publicly accessible via the following URL:
You can share this URL, and anyone with it can access the blob without authentication.

Important Considerations

Security Implications

  • Public Access Warning: Enabling public access allows anyone to access the blobs without authentication. Ensure that no sensitive data is stored in publicly accessible containers.

Storage Account-Level Setting

  • The --allow-blob-public-access parameter controls whether containers in the storage account can have public access. If set to false, no containers in the account can be made public, regardless of individual container settings.

Container-Level Setting

  • The --public-access blob setting allows anonymous read access to blob content but not to container metadata or the list of blobs.

References


This guide provides a step-by-step approach to setting up a publicly accessible Azure Blob Storage container using the Azure CLI.