How I Set Up Azure Storage for My First Public Website
Source: Dev.to
Introduction
I needed a place to store images and files for a website project. Azure Blob Storage provides a cloud‑based file system that can be accessed via a URL.
Search for Storage Accounts in Azure Portal
- Open the Azure portal and search for Storage accounts.
- Click + Create.
- Create a new resource group (e.g.,
website-storage). - Name the storage account (e.g.,
publicwebsite2024). - Click Review + create, then Create.
- After deployment finishes, click Go to resource.
Set Up High Availability
- In the storage account, go to Data management → Redundancy.
- Select Read-access geo-redundant storage (RA‑GRS).
- This creates a primary and a secondary location, ensuring availability if one region fails.
- Open Settings → Configuration.
- Turn on Allow Blob anonymous access and click Save.
Create Your Container
- Navigate to Data storage → Containers.
- Click + Container.
- Name the container
public. - Click Create.
Make Files Publicly Accessible
- Open the
publiccontainer. - Click Change access level.
- Select Blob (anonymous read access for blobs only) and confirm with OK.
- Upload a file: click Upload, choose an image or text file, then click Upload.
- After the upload, select the file and copy its URL from the Overview tab.
- Paste the URL into a new browser tab; the file should display.
Enable Soft Delete (Recycle‑Bin‑like Protection)
- Return to the storage account overview.
- Under Properties → Blob service, click Blob soft delete.
- Check Enable soft delete for blobs, set the retention period to 21 days, and click Save.
Testing Soft Delete
- In the container, select a file and click Delete.
- Click Show deleted blobs (top right).
- Select the deleted file, click the three‑dot menu, and choose Undelete.
- The file is restored.
Enable Versioning
- In the storage account Properties, locate Blob service → Versioning.
- Check Enable versioning for blobs and click Save.
- New uploads will retain previous versions automatically.
One Important Warning
If you encounter any issues, feel free to leave a comment for help. Please consider liking and sharing the guide.