DEV Community

Cover image for How to Create a Highly Available Storage Account for a Public Website
Oluwasegun Michael Adesiyan
Oluwasegun Michael Adesiyan

Posted on

How to Create a Highly Available Storage Account for a Public Website

Imagine you want to put pictures, documents, or even a small website online so anyone can see it. Microsoft Azure (a cloud service) lets you store files safely and make them available to the public.

Create a storage account with high availability

1.Create a storage account to support the public website
What is a storage account?

Think of it like a digital locker in the cloud where you keep your files. It’s managed by Microsoft Azure and can be accessed from anywhere.

  • In the portal, search for and select Storage accounts
    Storage accounts

  • Select + Create
    Create

-For resource group select new. Give your resource group a name and select OK

Select New
New resource group

New resource group created
Mikkyrg created

  • Set the Storage account name to publicwebsite. Make sure the storage account name is unique by adding an identifier.

Storage account name publicwebsitemikky created
publicwebsite

  • Take the defaults for other settings.
    Default settings

  • Select Review and then Create.
    Review+create

  • Wait for the storage account to deploy, and then select Go to resource

storage account to deploy being validated
Validation

Click Create
create

Deployment in progress
Deployment

Deployment Complete. Go to Resource
Resource

2.This storage requires high availability if there’s a regional outage.
What does high availability mean?

It means your files stay online even if one region (data center) has problems. Azure copies your files to another location.
High availability = your files stay online even if one region has problems.

Azure copies your files to another location.
Additionally, enable read access to the secondary region, Learn more about storage account redundancy

  • In the storage account, in the Data management section, select the Redundancy blade
    Redundancy

  • Ensure Read-access Geo-redundant storage is selected.
    This means your files are backed up in another region.
    Read-access Geo-redundant storage

  • Review the primary and secondary location information.
    primary and secondary location

3.Information on the public website should be accessible without requiring customers to login (Allow Public Access)
You want people to see your website without logging in.
Public access = anyone can view your files without logging in.

  • In the storage account, in the Settings section, select the Configuration blade.
    Settings-Configuration

  • Ensure the Allow blob anonymous access setting is Enabled
    Blob = file stored in Azure.
    Anonymous access = no password needed.

By default, it is disabled
Disabled blob anonymous access

Now enabled
Enabled blob anonymous access

  • Be sure to Save your changes. Save

Update
Saved

Create a blob storage container with anonymous read access

Container = a folder inside your storage account

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

  • In your storage account, in the Data storage section, select the Containers blade.
    Containers

  • Select + Container
    Container

  • Ensure the Name of the container is public
    Container-Public

  • Select Create.
    Create

Storage container successfully created
Storage container

Public

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

  • Select your public container.
    Public container

  • On the Overview **blade, select **Change access level.
    Change access level

  • Ensure the Public access level is Blob (anonymous read access for blobs only).
    Blob anonymous read access for blobs only

  • Select OK.
    ok

Access level successfully changed
Access level successfully changed

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.
    Container public

  • Select Upload.
    Upload

  • Browse to files and select a file. Browse to a file of your choice.
    Browse to files

  • Select Upload.
    File Upload

  • Close the upload window, Refresh the page and ensure your file was uploaded.
    Refresh

Upload confirmed
Upload

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

  • Select your uploaded file.
    uploaded file

  • On the Overview tab, copy the URL.
    URL

  • Paste the URL into a new browser tab.

  • If you have uploaded an image file it will display in the browser. Other file types should be downloaded.
    URL Image

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. Learn more about soft delete for blobs.
Soft delete = recycle bin for your files

  • Go to the Overview blade of the storage account.
    Storage Overview

  • On the Properties page, locate the Blob service section
    Blob service

  • Select the Blob soft delete setting.
    Blob soft delete

  • Ensure the Enable soft delete for blobs is checked.
    Enable soft delete for blob

Enable soft delete for blob- Checked
Enable soft delete for blob- Checked

  • Change the Keep deleted blobs for (in days) setting to 21. By default, this is 7 days 7 days

Changed to 21 days
21

  • Notice you can also Enable soft delete for containers.
    Enable soft delete for containers

  • Don’t forget to Save your changes.
    Save

Saved
saved

Confirmed from the Overview page
21 days

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.
    Public Container

  • Select the file you uploaded and then select Delete.

Select file uploaded
file

Select Delete

Delete

Delete

  • Select OK to confirm deleting the file.
    deleted

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

deleted blob

  • Select your deleted file, and use the ellipses on the far right, to **Undelete **the file.
    undelete in process

  • Refresh the container and confirm the file has been restored.
    Restored

Configure blob versioning

1.It’s important to keep track of the different website product document versions. Learn more about blob versioning.
What is versioning?

It keeps old versions of files when you upload new ones. Useful if you update documents often.
Versioning = keeps old versions of files when you upload new ones.

  • Go to the Overview blade of the storage account.
    Overview

  • In the Properties section, locate the Blob service section.
    Blob service

  • Select the Versioning setting.
    Versioning

  • Ensure the Enable versioning for blobs checkbox is checked.
    checked Enable versioning

  • Notice your options to keep all versions or delete versions after.
    Versions

  • Don’t forget to Save your changes.
    Save

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.

Conclusion

We’ve just:

Created a storage account for your website.

Made it highly available (safe from outages).

Allowed public access without login.

Added safety features like soft delete and versioning.

This setup is perfect for hosting images, documents, or even static websites on Azure — and now you understand every step.

Top comments (0)