Chapter 2 · AZ-204: Developing Solutions for Microsoft Azure Implement Azure Security
Shared Access Signatures
20 practice questions · 5 marks weightage
Practice questions
- Question 1Q-0A4BFDSee the answer and solution
An ASP.NET Core application must let a client download one specific blob for 15 minutes. The application already uses the storage account key to create the token. Which SAS configuration follows least privilege?
- A.Create a service SAS for the blob with read permission, HTTPS-only access, and an expiry time 15 minutes in the future.
- B.Create an account SAS with read, write, delete, and list permissions for all storage services and HTTPS-only access.
- C.Create a service SAS for the container with read, write, delete, and list permissions and an expiry time one day in the future.
- D.Create a user delegation SAS without authenticating the application with Microsoft Entra ID.
- Question 2Q-7D8622See the answer and solution
A company distributes service SAS tokens for blobs in a container. The tokens reference a stored access policy. A token is leaked, and the security team wants to invalidate all tokens that use that policy without rotating the storage account keys or changing access for unrelated SAS tokens. What should the team do?
- A.Delete or modify the stored access policy referenced by the SAS tokens.
- B.Change the container's public access level to Blob.
- C.Regenerate both storage account access keys.
- D.Change the IP address restriction in each token's URL without generating new tokens.
- Question 3Q-363BDFSee the answer and solution
A security-sensitive web API must issue a read-only SAS for one blob, but the API must not store or access a storage account key. The API runs under a Microsoft Entra service principal that has permission to generate user delegation keys for the storage account. Which implementation is appropriate?
- A.Use DefaultAzureCredential to authenticate a BlobServiceClient, call GetUserDelegationKeyAsync, create a BlobSasBuilder with Resource = "b" and read permission, and generate SAS query parameters with the user delegation key.
- B.Use DefaultAzureCredential to authenticate a BlobServiceClient, then call GenerateAccountSasUri with read, write, and list permissions.
- C.Construct a service SAS by placing the service principal's client secret in the SAS signature field.
- D.Set the blob container's public access level to Blob and return the blob URL without a SAS.
- Question 4Q-086CD9See the answer and solution
An API must allow a client to upload one newly created block blob for 20 minutes. The client must not be able to read, delete, or list blobs, and the request must use HTTPS. Which service SAS settings provide the least privilege?
- A.Permissions: cw; signed resource: b; protocol: HTTPS
- B.Permissions: rwdl; signed resource: c; protocol: HTTPS
- C.Permissions: r; signed resource: b; protocol: HTTPS
- D.Permissions: acwl; signed resource: c; protocol: HTTP or HTTPS
- Question 5Q-499BA6See the answer and solution
A solution must grant temporary access to both a blob container and an Azure Queue Storage queue by using one SAS. The application uses Microsoft Entra ID and is not allowed to store or access a storage account key. What is the correct conclusion?
- A.Use a user delegation SAS because it can authorize Blob Storage and Queue Storage.
- B.Use an account SAS generated with Microsoft Entra ID because account SAS tokens do not require an account key.
- C.The requirements cannot be met with one SAS; user delegation SAS is for Blob Storage, while account or service SAS requires an account key.
- D.Use a service SAS signed with the application's Microsoft Entra access token.
15 more questions on Shared Access Signatures
Sign up free to practise the full chapter. Questions you get wrong come back until you've mastered them.
Start practising freeFree to start · No credit card needed