Introduction
I needed a place to store images and files for a website project. Azure Blob Storage turned out to be perfect. it's basically a file system in the cloud that anyone can access via a URL.
This guide shows you exactly how to set it up, make files publicly accessible, and add some safety features so you don't lose your work if something gets deleted.
Create the Storage Account
- Search for Storage accounts in Azure Portal
- Click + Create
- Create a new resource group (name it something like website-storage)
- Name your storage account publicwebsite plus some numbers (like publicwebsite2024)
- Click Review then Create
- Wait for deployment, then click Go to resource
Set Up High Availability
This makes sure your files are backed up in multiple locations.
- Go to Data management → Redundancy
- Select Read-access geo-redundant storage
You'll see two locations: primary and secondary
Now if one region goes down, your files are still available. Cool, right?
Allow Public Access
By default, storage is locked down. We need to open it up for public website files.
- Go to Settings → Configuration
- Turn on Allow Blob anonymous access
- Click Save
Create Your Container
Containers are like folders that hold your files.
- Go to Data storage → Containers
- Click + Container
- Name it public
- Click Create
Make Files Publicly Accessible
- Click on your public container
- Click Change access level
- Select Blob (anonymous read access for blobs only)
- Click OK
Now anyone with the URL can view your files!
Upload and Test a File
- In your container, click Upload
- Choose any image or text file
- Click Upload
- After upload, click on your file
- Copy the URL from the Overview tab
- Paste it in a new browser tab
If you see your file, it worked! 🎉
Set Up Soft Delete (The Undo Button)
This is like having a recycle bin. If you accidentally delete something, you can get it back for 21 days.
- Go back to your storage account overview
- Find Properties → Blob service section
- Click Blob soft delete
- Check Enable soft delete for blobs
- Set it to 21 days
- Click Save
Testing Soft Delete
- Go to your container
- Select a file and click Delete
- Toggle Show deleted blobs (top right)
- Select the deleted file
- Click the three dots and choose Undelete
Your file is back!
Enable Versioning
This keeps a history of your file changes, like version control for your files.
- Back in storage account Properties
- Find Blob service → Versioning
- Check Enable versioning for blobs
- Click Save
Now when you upload a new version of a file, the old one is saved automatically.
You just set up cloud storage that's accessible from anywhere on the internet. This is the same technology that powers file hosting for major websites and apps.
One Important Warning
Since you made this publicly accessible, never upload sensitive information. Anything you put here can be accessed by anyone with the URL. No passwords, no private data, no confidential documents.
Got stuck anywhere? Drop a comment and I'll help you out. We're all figuring this stuff out together! Please like and share!!!
Top comments (1)
Thank you so much for the clear explanation 👏🏽. Excellent work!