DEV Community

Cover image for How to Provide storage for the public website
jeremiah enoghase
jeremiah enoghase

Posted on

How to Provide storage for the public website

This article describes the process guidelines for providing storage for a public website.

The first step is to create a storage account with high availability.

  • in the Azure portal, search for and select storage accounts.

storage account

  • select +create

+create

  • click on create new for the resource group, give it a name and select ok. set the storage account to public website and ensure it is unique by adding identifier. Select Review + Create.

  • click on create and wait for storage to deploy and then click on go to resource.

create and depoly

go to resource

  • In the Data management section in the storage account, select the Redundancy blade and ensure Read-access Geo-redundant storage is selected and click on save.

redundancy blade

-In the Settings section of the storage account, select the Configuration blade. Ensure the Allow blob anonymous access setting is Enabled and click on save.
Note: this is carried out to ensure the public website is accessible without requiring customers to login.

The next step is to create a blob storage container with anonymous read access.

  • In the Data storage section of the storage account, select the Containers blade. Select + Container and ensure the Name of the container is public. Select Create.

public container

  • Select your public container. On the Overview blade, select Change access level. Ensure the Public access level is Blob (anonymous read access for blobs only). Select OK. Note: this is to ensure Customers are able to view the images without being authenticated.

public container

public container

public container

Practice uploading files and testing access

  • Ensure you are viewing your container. Select Upload.

  • Browse to files and select a file and select Upload.
    Close the upload window, Refresh the page and ensure your file was uploaded.

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

  • Select your uploaded file. On the Overview tab, copy the URL. Paste the URL into a new browser tab. If you have uploaded an image file, it will display in the browser.

Configure soft delete

configuring soft delete ensures that the website documents can be restored if they’re deleted.

  • Go to the Overview blade of the storage account. -In the Data management section, select the Data protection blade -Ensure that the enable soft delete for blobs is checked. -Change the Keep deleted blobs for (in days) setting to 21. Notice you can also Enable soft delete for containers. Don’t forget to Save your changes.

soft delete

Configure blob versioning

  • Go to the Overview blade of the storage account. -In the Data management section, select the Data protection blade. -Ensure the Enable versioning for blobs checkbox is checked. Notice your options to keep all versions or delete versions after

kindly review and leave your comments.

Thank You

Top comments (0)