exam questions

Exam AZ-203 All Questions

View all questions & answers for the AZ-203 exam

Exam AZ-203 topic 20 question 2 discussion

Actual exam question from Microsoft's AZ-203
Question #: 2
Topic #: 20
[All AZ-203 Questions]

You need to construct the link to the summary report for the email that is sent to users.
What should you do?

  • A. Create a SharedAccessBlobPolicy and add it to the containers SharedAccessPolicies. Call GetSharedAccessSignature on the blob and use the resulting link.
  • B. Create a SharedAccessAccountPolicy and call GetSharedAccessSignature on storage account and use the resulting link.
  • C. Create a SharedAccessBlobPolicy and set the expiry time to two weeks from today. Call GetSharedAccessSignature on the blob and use the resulting link.
  • D. Create a SharedAccessBlobPolicy and set the expiry time to two weeks from today. Call GetSharedAccessSignature on the container and use the resulting link.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️
Scenario: Processing is performed by an Azure Function that uses version 2 of the Azure Function runtime. Once processing is completed, results are stored in
Azure Blob Storage and an Azure SQL database. Then, an email summary is sent to the user with a link to the processing report. The link to the report must remain valid if the email is forwarded to another user.
Create a stored access policy to manage signatures on a container's resources, and then generate the shared access signature on the container, setting the constraints directly on the signature.
Code example: Add a method that generates the shared access signature for the container and returns the signature URI. static string GetContainerSasUri(CloudBlobContainer container)
{
//Set the expiry time and permissions for the container.
//In this case no start time is specified, so the shared access signature becomes valid immediately.
SharedAccessBlobPolicy sasConstraints = new SharedAccessBlobPolicy(); sasConstraints.SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddHours(24); sasConstraints.Permissions = SharedAccessBlobPermissions.List | SharedAccessBlobPermissions.Write;
//Generate the shared access signature on the container, setting the constraints directly on the signature. string sasContainerToken = container.GetSharedAccessSignature(sasConstraints);
//Return the URI string for the container, including the SAS token. return container.Uri + sasContainerToken;
}
Incorrect Answers:
C: Call GetSharedAccessSignature on the container, not on the blob.
References:
https://docs.microsoft.com/en-us/azure/storage/blobs/storage-dotnet-shared-access-signature-part-2

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
shanky_007
Highly Voted 5 years, 6 months ago
correct ans: C. Create a SharedAccessBlobPolicy and set the expiry time to two weeks from today. Call GetSharedAccessSignature on the blob and use the resulting link.
upvoted 42 times
jw_duke
4 years, 11 months ago
IMO, To be specific, to secure the summary report is to secure a blob.
upvoted 2 times
...
cbn
4 years, 4 months ago
The link must remain valid. There is no mention about two weeks, therefore cannot be C or D.
upvoted 1 times
...
...
Phantom88
Highly Voted 5 years, 1 month ago
It should be A and use a stored access policy. "In the case of a security breach, access to all summary reports must be revoked without impacting other parts of the system." https://docs.microsoft.com/en-us/azure/storage/common/storage-stored-access-policy-define-dotnet
upvoted 8 times
lau13
5 years, 1 month ago
Agreed, A should be the correct answer because we must be able to revoke it after.
upvoted 1 times
...
all_nicks_are_taken
5 years, 1 month ago
But the same article states: "Stored access policies are supported for a service SAS only. Stored access policies are not supported for account SAS or user delegation SAS." Therefore it can't be used here
upvoted 2 times
Phantom88
5 years ago
It means that policy can be applied to the scope of particular service (Blob, File, Table, etc.) and not to the entire storage account
upvoted 1 times
...
...
...
Azurite
Most Recent 4 years, 3 months ago
So what's the Final Answer. is it A?
upvoted 1 times
...
xewebikezsevysqduv
4 years, 9 months ago
D is correct I think. "In the case of a security breach, access to all summary reports must be revoked without impacting other parts of the system." - So that we can revoke in one go. 2 weeks is also good for security.
upvoted 1 times
...
Mike8
4 years, 10 months ago
I would go with A. There is nothing mentioned about a requirement for the two weeks. You should access the blob, not the account or the container.
upvoted 2 times
Chilred
4 years, 5 months ago
Yes, but I think because it is SAS, there is always an expire date
upvoted 2 times
...
...
ankitsingh12
5 years, 1 month ago
Ans A is correct. The second way to create an SAS URI is to set up a stored access policy for the container and specify a name, start time, expiration time, permissions, etc. Then when you need an SAS URI, you can create it and specify the name of the stored access policy instead of all of the parameters required on the ad hoc version of the URI. The information will be retrieved from the stored access policy when authorization takes place. Also, unlike with the adhoc SAS URI, if you want to revoke access, you can simply change the stored access policy and all SAS URI’s that inherited from that stored access policy will immediately be modified; this is preferable to changing the storage account key! https://www.red-gate.com/simple-talk/cloud/platform-as-a-service/azure-blob-storage-part-9-shared-access-signatures/
upvoted 6 times
...
vova12345
5 years, 1 month ago
return container.Uri + sasContainerToken; it's incorrect the url should be to the blob file not to the container. answer: C
upvoted 1 times
...
[Removed]
5 years, 2 months ago
The given answer is correct
upvoted 3 times
...
WilsonShen
5 years, 2 months ago
Container mean AKS Container ? ==> Blob mean Blob container
upvoted 2 times
...
jandayranl
5 years, 4 months ago
https://markheath.net/post/azure-container-shared-access-signature
upvoted 5 times
jnlhj
5 years, 1 month ago
So D is right.
upvoted 2 times
lau13
5 years, 1 month ago
Not really. You can create a SAS for a container or a blob - https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-service-sas-create-dotnet So blob or container? It is actually depending on the requirement - for this question, the requirement is for the blob. Plus, we need to be able to revoke it if something goes wrong. So answer is A.
upvoted 7 times
...
...
...
Khang
5 years, 4 months ago
Should be C
upvoted 4 times
rrongcheng
4 years, 11 months ago
Agree, It should be C. The access should be on Blob which is the receipt user uploaded.
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...