How to Use Blob Storage: SAS URL Generation and Object Replication Made Easy


Thank you for coming to my blog post. I believe you would learn a thing or two at the end of reading and following through with my post. I have taken my time to document step-by-step details with pictorial evidence of how you can create a blob storage, generate SAS URL and also do an object replication on your storage.
To begin, sign into your Azure account. We would be creating a storage account which would be needing for this project. In the diagram below, I have highlighted three (3) different routes with which we can go about creating the storage account.
CREATING STORAGE ACCOUNT
- In the search bar, type Storage Account, or Click on Storage Account or Click on Create a resource.
- You can click either of the two (2) places highlighted in the diagram to begin the process of creating a storage account.
- Give your storage account a unique name. Select a Resource Group and Region where you want the storage account to be hosted, select Next.
- I selected Azure Blob Storage because I am creating a blob storage.
- For the Performance, I chose Standard for the purpose of this tutorial.
- For Redundancy, I am choosing GZRS because I want my storage to be replicated across availability zones.
- I selected Hot under Access tier because the storage would be accessed frequently.
- I left every other part in its default setting and went ahead to Create.
- After successful deployment, select Go to Resource.
To create a container under the storage we just created, go to Data Storage, Select Containers, select +.
Name the container and select Container, then Create.
- The container is created in the storage account.
SAS URL GENERATION
- Whatever we need to put into the storage account has to be uploaded. Open the Container, Click Upload, Browse for files, select the file you want to upload and click Upload.
- Below, we can see the file has been uploaded into the Container.
- To see what we have uploaded, double click on the document and copy the URL.
- Open a new tab and paste the URL you have copied and you would see the object that was uploaded into the container.
Remember that anyone who has the URL can always view or do anything to the object in the container except you have selected the level of access you have granted to the container.
In this part, I only want whoever has the URL to have access to whatever is in my container for a given period of time. That way, I had to generate a SAS URL which would only grant access for the time specified.
To generate the SAS, right click on the 3 dots and select Generate SAS.
- Make all necessary changes to the date and time.
Click Generate SAS token and URL and copy the SAS URL because that is the URL that would be used to confirm if the adjustment that was made to time is effected.
Click Save.
- At the expiration of the time that was set, paste the SAS URL that was copied and you would get an error message. This shows you that whoever has the URL no longer has access to the content of the container.
OBJECT REPLICATION
- For us to replicate any object, we need to have at least two (2) storage accounts and containers.
In the diagram below, I created another storage account as indicated.
- I would I am using Storage1 as my source. For the replication to work, we need to create replication rules.
- Select the destination storage account.
Under Container pair details, you select the Source container and the Destination container. Then select Create.
The source container is where the object would be uploaded while the destination container is where the replicated object would be.
- Here, you can see the replication rule has been created.
- Go back to container 1 and upload an object into the container. Follow the direction I highlighted when I uploaded an object in the container previously.
- Object has been uploaded in container 1 . You have to wait for some time for the replication to finally come up in container 2.
- Note that Object took 2 minutes to be replicated in container 2 as seen below.
I hope I have been able to help somebody go through this process with no hassles.
Thank you.
Subscribe to my newsletter
Read articles from Ms. B directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Ms. B
Ms. B
Hi, I'm a tech enthusiast who has decided to document her cloud journey as the day goes by. Stay tuned and follow me through this journey which I believe would be a wonderful experience. I'm also a team player who loves collaborating with others to create innovative solutions.