DEV Community

Cover image for Creating a High-Availability Storage Account for a Public Website
OTTAH CHUKWUEBUKA
OTTAH CHUKWUEBUKA

Posted on

Creating a High-Availability Storage Account for a Public Website

Introduction

In this exercise, you will learn how to create and configure a Microsoft Azure Storage Account designed to support a public website environment. The goal is to ensure high availability, public accessibility, and data resilience through features such as soft delete and** blob versioning**.

This task will guide you through creating:

  • A storage account with geo-redundant availability
  • A blob container with anonymous public access
  • Soft delete protection to recover deleted files
  • Blob versioning to maintain and restore older versions of files

By the end of this lab, you will have a fully functional storage setup suitable for hosting website content used in testing, training, or live demonstration environments.

**Task 1: Create a High-Availability Storage Account

Step 1: Create the Storage Account**

  1. In the Azure Portal, search for and select Storage accounts.

  1. Click + Create.

  1. Under Resource group, select Create new, provide a unique name for your resource group, and click OK.

  1. Set the Storage account name to publicwebsite. If the name is unavailable, append a unique identifier (for example, publicwebsite01, or any unique name of your choice).

  1. Accept the default settings for other options.

  2. Select Review + Create, then click Create.

  1. Once deployment completes, select Go to resource to open your new storage account.

Step 2: Configure High Availability (Geo-Redundant Storage)

  1. In your storage account, under Data management which is located at the side menu, select Redundancy.

  1. Ensure that Read-access geo-redundant storage (RA-GRS) is selected.

  • This option ensures that your data remains available even during a regional outage.
  1. Review the Primary and Secondary location details to understand your redundancy configuration.

Task 2: Enable Anonymous Public Access

  1. In your storage account, go to Settings > Configuration.

  1. Locate the Allow blob anonymous access setting and set it to Enabled.

  1. Click Save to apply your changes.

This setting allows users to access public website content without needing to sign in.

Task 3: Create a Blob Storage Container

Step 1: Create the Container

  1. In your storage account, go to Data storage > Containers.

  1. Click + Add Container.

  1. Set the Name to public.

  2. Select Create.

Step 2: Configure Public Access for the Container

  1. click and Open the newly created public container.

  1. On the Overview blade, select Change access level.

  1. Under Public access level, choose Blob (anonymous read access for blobs only).

  1. Click OK to confirm.

This allows website visitors to view content stored in this container without authentication.

Task 4: Upload and Test Files

  1. While viewing your public container, click Upload.

  1. Browse your local system and select a sample file (e.g., an image or text file).

  2. Click Upload.

  3. Refresh the page to verify the file upload.

  4. Select the uploaded file, copy its URL from the Overview tab, and open it in a new browser tab.

  • Image files should display directly.
  • Other file types (e.g., text or PDF) may be downloaded automatically.

Task 5: Enable Soft Delete for Blobs

Step 1: Configure Soft Delete

  1. In your storage account, remember, to go to storage account, you search for storage account in the search and click on it in the options, Click on the storage account where you want to enable soft delete., then go to the Overview blade.

  2. In the left navigation panel, scroll down to the Data management section.

  3. Select Data protection.

  4. Scroll to the Blob service section and select Blob soft delete.

  5. Enable the Soft delete for blobs checkbox.

  6. Set Retention period to 21 days.

  7. Click Save.

Note: This feature ensures deleted files can be recovered within 21 days of deletion.

Step 2: Test Soft Delete

  1. Navigate to your public container.

  1. Select the uploaded file and click Delete → OK.

  1. On the container’s Overview page, toggle Show deleted blobs.

  1. Locate the deleted file, click the ellipsis (⋯) beside it, and choose Undelete.

  1. Refresh the container to verify the file has been restored.

Task 6: Enable Blob Versioning

  1. In your storage account, open the Overview blade.

  2. In the Blob service section, select Versioning.

  1. Check the box to Enable versioning for blobs.

  2. Click Save.

Versioning automatically maintains older versions of files whenever changes are made, providing an additional layer of data protection.

Conclusion

You have successfully created and configured a high-availability Azure Storage Account with support for anonymous public access, soft delete recovery, and blob versioning.

This setup ensures that:

Website content remains highly available, even during regional outages.

Users can access files without authentication, ideal for public-facing websites.

Deleted or overwritten files can be restored easily, improving reliability and reducing data loss risks.

With this foundation in place, you can confidently host, test, and maintain static website assets or training materials in a secure and resilient Azure storage environment.

Top comments (0)