DEV Community

Cover image for Microsoft Certified Azure Administrator Associate Exam (AZ-104) Lab Preparation #4.2: Storage Account and Access Token
David Au Yeung
David Au Yeung

Posted on

Microsoft Certified Azure Administrator Associate Exam (AZ-104) Lab Preparation #4.2: Storage Account and Access Token

Introduction

To pass the AZ-104 exam, you need to complete several live online lab tests. This article will teach you how to grant limited access to Azure Storage resources using Shared Access Signatures (SAS). We will continue our previous lab tutorial as an example.

Steps

Step 1:
Navigate to "Storage accounts."
Check if our account "davidaystorageaccount" has Blob anonymous access disabled.

Image description

And you will see the uploaded file will response PublicAccessNotPermitted.

Image description

Step 2:
In the "Storage accounts," click on "Shared access signature."

Image description

Step 3:
In the "Shared access signature" section, configure the following settings:

Allowed services: Blob

Allowed resource types: Service, Container, Object

Image description

Start and expiry date/time: Set according to your preference.

Then, click "Generate SAS and connection string."

Image description

Note that the signing key "key1" is stored in "Access keys":

Image description

Step 4:
Copy the generated "SAS token".

?sv=2022-11-02&ss=b&srt=sco&sp=rwdlaciytfx&se=2025-01-06T18:52:17Z&st=2025-01-06T10:52:17Z&spr=https&sig=w6DGYscuw3bBilBys2j2g6GqBN2e%2FSMGu5GrIbtjMuA%3D

Image description

Testing

Paste the SAS token into the target blob resource URL:

https://davidaystorageaccount.blob.core.windows.net/folder1/hello_david.jpg?sv=2022-11-02&ss=b&srt=sco&sp=rwdlaciytfx&se=2025-01-06T18:52:17Z&st=2025-01-06T10:52:17Z&spr=https&sig=w6DGYscuw3bBilBys2j2g6GqBN2e%2FSMGu5GrIbtjMuA%3D

Image description

You should replace the SAS token part in the URL with the one you copied.

Remark

If you rotate "key1" stored in "Access keys," all previously generated SAS tokens using "key1" will become invalid.

Image description

Image description

Conclusion

In this lab, you learned how to create a Shared Access Signature (SAS) for an Azure Storage account, allowing you to grant limited access to your storage resources. This is a crucial skill for the AZ-104 exam, as it demonstrates your ability to manage Azure Storage securely. Always remember that rotating your access keys will invalidate existing SAS tokens, so plan your security measures accordingly. Continue practicing these steps to ensure you are well-prepared for your exam!

Top comments (0)