DEV Community

Cover image for Provide storage for the public website
Oluwanifesimi
Oluwanifesimi

Posted on

Provide storage for the public website

Hosting a Public Website on Azure Storage — A Hands-On Guide

Gone are the days of managing web servers and worrying about uptime. With Microsoft Azure Storage, you can host a static public website securely, scalably, and affordably using just a storage account.

In this step-by-step tutorial, I’ll guide you through:

  • What a storage account is
  • How to configure it for public access
  • How to upload your content and manage versioning

What Is a Storage Account in Azure?

A Storage Account in Azure is a container for all your cloud-based data services. It provides access to services like:

  • Blob Storage (for unstructured data like HTML, CSS, JS files)
  • File Shares
  • Queues
  • Tables
  • Disks

When you create a storage account, you define its:

  • Region (where your data is stored)
  • Performance tier (Standard or Premium)
  • Replication strategy (e.g., LRS, GRS)
  • Access settings (public or private)

Why it matters:

A storage account gives you centralized control over how your website files are stored, accessed, and delivered to users.

Why Use Azure Storage for a Public Website?

  • No need to manage servers
  • Highly available and globally distributed
  • Scales automatically with traffic
  • Cost-effective for static content
  • Supports custom domains and HTTPS

Step-by-Step: Host a Public Website with Azure Storage

Create a storage account with high availability.

1. Create a Storage Account

  • Go to the Azure Portal
  • In the portal, search for storage accounts search storage acct
  • select and create storage account select and create
  • For resource group select new. Give your resource group a name and select OK. new resource group
  • Set the Storage account name to publicwebsite. Make sure the storage account name is unique by adding an identifier. storage name
  • Take the defaults for other settings,Select Review and then Create. default
  • Wait for the storage account to deploy. deployment

2. This storage requires high availability if there’s a regional outage. Additionally, enable read access to the secondary region.

  • In the storage account, in the Data management section, select the Redundancy blade, ensure Read-access Geo-redundant storage is selected. data management RA-GRS (Read-access Geo-redundant storage) replicates your data to a secondary Azure region that is hundreds of miles away from the primary region, and allows read access to the replicated data. It’s used to enhance data durability, disaster recovery, and high availability.
  • Review the primary and secondary location information primary/secondary

3. Information on the public website should be accessible without requiring customers to login.

  • In the storage account, in the Settings section, select the Configuration blade, Ensure the Allow blob anonymous access setting is Enabled. Be sure to Save your changes. allow blob

This ensures visitors can access public content without logging in.

Create a blob storage container with anonymous read access

1. The public website has various images and documents. Create a blob storage container for the content.

  • In your storage account, in the Data storage section, select the Containers blade. container
  • Select + Container, Ensure the Name of the container is public,
    Select Create.
    add container

    2. Customers should be able to view the images without being authenticated. Configure anonymous read access for the public container blobs.

  • Select your public container.
    public

  • On the Overview blade, select Change access level, Ensure the Public access level is Blob (anonymous read access for blobs only), Select OK.
    blob access

3. Practice uploading files and testing access.

1. For testing, upload a file to the public container. The type of file doesn’t matter. A small image or text file is a good choice.

  • Ensure you are viewing your container,click on the container created "public" public
  • Select Upload. select upload
  • Browse to files and select a file, Browse to a file of your choice, Select Upload. browse, select, upload file
  • Close the upload window, Refresh the page and ensure your file was uploaded

2. Determine the URL for your uploaded file. Open a browser and test the URL.

  • Select your uploaded file. select uploaded file
  • On the Overview tab, copy the URL. copy url
  • Paste the URL into a new browser tab. paste url If you have uploaded an image file it will display in the browser. Other file types should be downloaded.

Configure soft delete

1. It’s important that the website documents can be restored if they’re deleted. Configure blob soft delete for 21 days.

  • Go to the Overview blade of the storage account. On the Properties page, locate the Blob service section. Select the Blob soft delete setting. blob soft delete
  • Ensure the Enable soft delete for blobs is checked.
    Change the Keep deleted blobs for (in days setting is 21.
    Notice you can also Enable soft delete for containers.
    21 days soft deleting
    Don’t forget to Save your changes.

    2. If something gets deleted, you need to practice using soft delete to restore the files.

  • Navigate to your container where you uploaded a file.
    navigation

  • Select the file you uploaded
    select file uploaded

  • select Delete, Select OK to confirm deleting the file.
    confirm delete

  • On the container Overview page, toggle the slider Show deleted blobs, This toggle is to the right of the search box.
    overview

  • Select your deleted file, and use the ellipses on the far right, to Undelete the file.
    undelete
    Refresh the container and confirm the file has been restored.

Configure blob versioning

1. It’s important to keep track of the different website product document versions.

  • Go to the Overview blade of the storage account. In the Properties section, locate the Blob service section, Select the Versioning setting. versioning Ensure the Enable versioning for blobs checkbox is checked, Notice your options to keep all versions or delete versions after, Don’t forget to Save your changes. enable versioning ### 2. As you have time experiment with restoring previous blob versions.
  • Upload another version of your container file. This overwrites your existing file, Your previous file version is listed on Show deleted blobs page.

Final Thoughts

Hosting a public website with Azure Storage is efficient, flexible, and beginner-friendly. Whether you’re showcasing a portfolio, launching a product page, or building an internal tool—Azure simplifies the process with minimal setup.

If you’ve made it this far, you’ve configured:

  • High-availability storage
  • Secure public access
  • Upload and version control
  • Recovery options with soft delete

Feel free to share your hosted link or let me know how your setup went!

*Written by Oluwanifesimi *

Top comments (0)