Introduction
The success of any website especially a public-facing one depends on how reliably it delivers content to visitors. Imagine running an e-commerce storefront, a documentation portal, or even a simple company website: if the files go down, or if critical documents are accidentally deleted, your visitors lose trust in your brand. That’s where cloud storage comes in.
Azure Storage is a core building block for hosting static content like images, HTML files, PDFs, or any document that should be accessible online. It’s affordable, flexible, and scales globally. But the real power comes when you combine it with high availability, soft delete, and versioning. These features ensure your files are protected against accidental deletion, version conflicts, or even a whole regional outage.
This blog will show you step by step on how to use Azure Blob Storage to build a simple public website that anyone can access without authentication. You’ll see how to make your data resilient, how to recover lost files, and how to keep track of multiple versions of the same file. By the end, you’ll understand how enterprise-grade storage resilience can be achieved with just a few clicks in the Azure portal.
Architecture Diagram
At its simplest, our architecture consists of:
- One Azure Storage Account to hold the website data.
- One Blob Container within the storage account to organize and store website documents, images, or static files.
This setup can serve web content directly to users anywhere in the world, backed by Azure’s global infrastructure.
Skilling Tasks Overview
Before we get practical, here’s what you’ll accomplish:
- Create a highly available storage account with redundancy for regional failures.
- Allow anonymous public access so customers don’t need to log in to view website content.
- Set up a blob container to hold your website’s files.
- Turn on soft delete to recover deleted files within a set period.
- Enable blob versioning to manage changes and restore previous versions when needed.
Step 1: Create a Storage Account with High Availability
To start, you’ll need a storage account to store your website’s files:
In the Azure portal, search for Storage accounts and select + Create.
For Resource group, create a new one and give it a clear name (for example, Ibrahim).
Give your storage account a unique name, such as publicwebsite123.
To ensure your storage account remains available during a regional outage, configure geo-redundant storage:
- In your storage account, open Data management and select Redundancy.
- Choose Read-access Geo-redundant storage (RA-GRS). This replicates your data across regions and allows read access from the secondary location if the primary becomes unavailable.
Step 2: Enable Anonymous Public Access
For a public website, your visitors shouldn’t have to sign in to view files:
- In the storage account’s Settings, go to Configuration.
- Make sure Allow blob anonymous access is Enabled.
- Click Save.
This ensures website files like images or PDFs are accessible to everyone.
Step 3: Create a Blob Container for Website Content
A blob container organizes your website’s files:
In your storage account, under Data storage, select Containers.
Open your
damilola
container, click Change access level, and set it to Blob (anonymous read access for blobs only).
This means the files inside the container can be read publicly, but users can’t browse the full container list.
Step 4: Upload and Test Access
Now, upload a test file:
- Inside the
damilola
container, select Upload, browse your device, choose a file (an image or document), and upload it. - After uploading, click the file and copy its URL from the Overview tab.
- Paste the URL in a new browser tab. If it’s an image, it should display directly; other file types may download.
Step 5: Enable Soft Delete
What is Soft Delete?
Soft delete in Azure Blob Storage acts like a recycle bin for your cloud files. When you delete a blob, it’s not immediately lost forever. Instead, it goes into a soft delete state for a defined retention period (like 7, 14, or 21 days). During this window, you or any authorized admin can easily undelete the blob and restore it to its original state.
This is critical for accidental deletions. Developers, admins, or automation scripts sometimes delete the wrong file. Without soft delete, recovery means restoring from an offline backup (if you have one). With soft delete, recovery takes seconds no extra tools needed.
Accidentally deleting website files shouldn’t be the end of the world. Blob soft delete allows you to restore deleted files easily:
- In your storage account’s Overview, find Blob service and open Soft delete.
- Enable Soft delete for blobs, and set the retention period to 21 days.
- Save your settings.
To practice:
- Delete your test file from the container.
- In the container’s Overview, toggle Show deleted blobs.
- Find your deleted file, click the ellipses (...) next to it, and choose Undelete.
- Refresh the container then your file should be back!
Step 6: Configure Blob Versioning
What is Blob Versioning?
Blob versioning is an automatic way to keep track of every change made to your blobs. Whenever you overwrite an existing blob with a new version (for example, updating a PDF or replacing an image), Azure keeps the old version.
This means:
- You never lose the original content.
- You can roll back to an earlier version if needed.
- Every version has a unique ID and timestamp.
Unlike soft delete, which protects only against deletions, versioning protects against unwanted changes. Accidentally replaced the wrong file? Roll back to the earlier version in a few clicks.
Blob versioning lets you track and restore previous versions of your files — useful for managing website content updates:
- In the storage account’s Overview, under Blob service, select Versioning.
- Enable Versioning for blobs and save.
To test versioning:
- Upload an updated version of your test file (using the same file name).
- This overwrites the file but keeps the older version.
- You can view and restore old versions in the Show deleted blobs area or through version history.
Conclusion
With these steps, you now have a resilient Azure Storage setup for a simple public website: highly available, securely accessible by the public, and protected against accidental deletions or unwanted overwrites.
By combining high availability, anonymous access, soft delete, and blob versioning, you gain both control and peace of mind ensuring your website content stays online and recoverable at all times.
Top comments (0)