Creating a Highly Available Public Website with Azure Blob Storage

This guide provides a comprehensive walkthrough for setting up a highly available public website using Azure Blob Storage. We’ll cover creating a storage account, configuring public access, enabling soft delete and versioning, and testing your setup.

Creating a Highly Available Storage Account

  1. Navigate to Storage Accounts: In the Azure portal, search for and select “Storage accounts.”
  2. Create a New Storage Account: Click “+ Create.”
  3. Configure Account Details: Create a new resource group or select an existing one. Set the storage account name (e.g., “publicwebsite”).
  4. Review and Create: Review the settings and click “Create.”
  5. Go to Resource: Once deployment completes, select “Go to resource.”
  6. Set Redundancy: In the storage account, under “Data management,” select “Redundancy.” Choose “Read-access Geo-redundant storage” for high availability.

Enabling Anonymous Public Access

To allow public access to your website content:

  1. Open Configuration Blade: In the storage account, under “Settings,” select “Configuration.”
  2. Allow Anonymous Access: Enable “Allow blob anonymous access” and save your changes.

Creating a Public Blob Container

  1. Navigate to Containers: In the storage account, under “Data storage,” select “Containers.”
  2. Create a Container: Click “+ Container.” Name the container “public” and save.

Configuring Anonymous Read Access for Blobs

  1. Select the Public Container: Click on the newly created “public” container.
  2. Change Access Level: On the “Overview” blade, select “Change access level.” Set the “Public access level” to “Blob (anonymous read access for blobs only)” and click “OK.”

Uploading Files and Testing Access

  1. Upload a File: Within the “public” container, select “Upload.” Browse and select a file, then click “Upload.”
  2. Verify Upload: Close the upload window, refresh the page, and confirm the file is listed.
  3. Get File URL: Select the uploaded file. On the “Overview” tab, copy the URL.
  4. Test Access: Paste the URL into a new browser tab. The file should display (if an image) or download (other file types).

Enabling Soft Delete for Easy Restoration

  1. Go to Blob Service Properties: On the storage account’s “Overview” blade, navigate to the “Properties” page and find the “Blob service” section. Select “Blob soft delete.”
  2. Configure Soft Delete: Enable “Soft delete for blobs” and set the retention period (e.g., 21 days). Optionally, enable “Soft delete for containers.” Save the changes.
  3. Test Soft Delete: Delete a file from the container. Then, on the container’s “Overview” page, toggle the “Show deleted blobs” slider (next to the search box). Select the deleted file and click “Undelete.” Refresh to verify restoration.

Enabling Blob Versioning

  1. Navigate to Versioning Settings: On the storage account’s “Overview” blade, under “Properties” and “Blob service,” select “Data protection” then “Versioning.”
  2. Enable Versioning: Check “Enable versioning for blobs.” Configure version retention settings as needed. Save the changes.

This setup ensures your website content is highly available, easily accessible, and protected against accidental deletion. With geo-redundancy, soft delete, and versioning, you can confidently host your website on Azure Blob Storage.

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed