Creating a Storage Account for a Public Website on Azure
Tags: cloud, azure, cloudcomputing, beginners
Published: 2024-05-22 10:49:00

In this post, I'll be showing you how to create and configure a storage account for a company's website. The storage account is for product images and videos, documents and so on. Requirements for this are:

- 
Storage account with high availability.

- 
Storage account should have anonymous public access.

- 
Blob storage container for the website images, videos and other documents.

- 
Soft delete so files can be easily restored.

- 
Blob versioning to keep track of the different website product document versions.
_So let's get to it_

In Azure portal, search for and select Storage accounts.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u8xuq6ycyizv9rbwx69w.png)
Select **+ Create**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6w6t9ua1xvyy1s50srzs.png)
Give your **resource group** a name.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vchrsov05bpyva4zg76f.png)
Input **storage account name** and select **Region**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rf73pev0aoh4yben4h9d.png)
To ensure high availability, for **Redundancy** select **Read access Geo Redundant Storage**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gjx8iy8z6o2j1u4v1kea.png)
Select **Review** then **Create**.

Wait for deployment to complete, then **Go to Resource**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mb6wxvd8c38ua0wuj29r.png)
To ensure information on public website is accessible go to the **Settings** section of the storage account, select the **Configuration** blade.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t5uu4w3thnuaalig7njf.png)
Ensure the **Allow blob anonymous access** setting is **Enabled**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nlazwdf226x39rjszbug.png)
Save changes.

To create a blob storage container for the content of the website, go to the **Data storage** section of storage account, select the **Containers** blade.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hs8dmue6qgxvedwmo2cz.png)
Select **+ Container**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/64ve5dbubw14eq2xaqml.png)
Give container a name and select **Create**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xjlkql3brjt433uss7c2.png)

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ojkb72f56sl24id1e3n7.png)
On the **Overview** blade, select **Change access level**. Ensure the **Public access level** is set to **Blob (anonymous read access for blobs only)**. Select **OK**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xzxn1ec4xk5afcvkn33s.png)

Test by uploading a file to the public container. It could be an image or a text file. Select **Upload**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j1cjvjwsum3cvq7p0740.png)
**Browse for files** and select a file. Browse to a file of your choice.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2niivlr3gz0gsaa10pw9.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/do57buyr6aqn3a1k85bv.png)
Select **Upload**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ls3et6tfc60e2l1qe59.png)

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7bidoc7n23vi0cgsm0yi.png)
Select your uploaded file.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tfvfbf7ouct3oozxt0qr.png)

On the **Overview** tab, copy the **URL**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fv7sxlb82ppwe69ac6y5.png)

Paste the URL into a new browser tab.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8rrlzcb5lw3uj9nmv1q0.png)

Uploaded image file will display in the browser.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mg82qoef6i42riqnn74t.png)

Now, it's time to configure soft delete. This is to ensure that documents can be restored if they’re deleted.
Go to the **Overview** blade of the **storage account**. In the **Properties** section, locate the **Blob service** section.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vybdjgat7xzt5uuxeuu2.png)
Select the **Blob soft delete** setting.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2eef3w635wwy783lokug.png)
Ensure the **Enable soft delete for blobs** is checked and change the **Keep deleted blobs for (in days)** setting to 21.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/swea4q7fdp55l01hpj83.png)
Save changes.

Next step is to configure versioning. This is 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.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sr1so0bepxy5d8g727dy.png)
Ensure the **Enable versioning for blobs** checkbox is checked.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/td8cw7z99pdivujrcet1.png)
Save changes.