exam questions

Exam AZ-204 All Questions

View all questions & answers for the AZ-204 exam

Exam AZ-204 topic 8 question 1 discussion

Actual exam question from Microsoft's AZ-204
Question #: 1
Topic #: 8
[All AZ-204 Questions]

DRAG DROP -
You need to add code at line PC32 in Processing.cs to implement the GetCredentials method in the Processing class.
How should you complete the code? To answer, drag the appropriate code segments to the correct locations. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: AzureServiceTokenProvider()
Box 2: tp.GetAccessTokenAsync("..")
Acquiring an access token is then quite easy. Example code:
private async Task<string> GetAccessTokenAsync()
{
var tokenProvider = new AzureServiceTokenProvider();
return await tokenProvider.GetAccessTokenAsync("https://storage.azure.com/");
}
Reference:
https://joonasw.net/view/azure-ad-authentication-with-azure-storage-and-managed-service-identity

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
coffecold
Highly Voted 2 years, 3 months ago
To prevent reading the cases multiple times: Please see the spots below where you can find the questions (page/topic/question/subject) Litware Inc 47 8 1 code : GetCredentials method 47 8 2 code : disaster recovery requirements 51 14 1 code : set encryption with request to blob storage 51 14 2 ARM set keyVault access policy 53 20 1 prevent blob writing concurrency problems 54 20 2 resolve capacity issue at function processing 54 20 3 resolve capacity issue at extensive logging
upvoted 40 times
warchoon
1 year, 10 months ago
Wide World Importers 7/1 7/2 12/1 12/2 23/1 23/2 Litware Inc. 8/1 8/2 14/1 14/2 20/1 20/2 20/3 Coho Winery produces 9/1 9/2 22/1 22/2 28/1 28/2 VanArsdel, Ltd. 10/1 10/2 10/3 10/4 15/1 15/2 21/1 29/1 29/2 30/1 Contoso, Ltd. 11/1 11/2 11/3 11/4 11/5 16/1 16/2 27/1 27/2 31/1 31/2 31/3 City Power & Light 13/1 13/2 13/3 13/4 13/5 13/6 17/1 17/2 18/1 24/1 24/2 32/1 Proseware, Inc. 19/1 19/2 19/3 19/4 25/1 25/2 25/3 26/1
upvoted 23 times
examtopicsLogin123
1 week, 1 day ago
also VanArsdel, Ltd. 3/46 5/43 Fourth Coffee 3/60 3/64 4/75 4/77 5/56 5/57 5/60 6/53 6/54 for the last two I provided the numbers specified on the page, but they have different numbers in URL and title: https://www.examtopics.com/discussions/microsoft/view/151609-exam-az-204-topic-6-question-63-discussion/ https://www.examtopics.com/discussions/microsoft/view/150590-exam-az-204-topic-6-question-62-discussion/
upvoted 2 times
...
Dkijc
4 months ago
Let me add: Pickle 2/63 4/69 4/70 4/71 4/72 5/46 5/47 5/48 5/49 6/59
upvoted 3 times
...
alejary
1 year, 10 months ago
I know that 7/1 means topic 7, question 1, but where we can find use case description?
upvoted 1 times
...
...
OPT_001122
2 years, 2 months ago
Great Help
upvoted 1 times
...
sadish003
1 year, 10 months ago
Sorry, couldn't understand what you mean. You mean this code (47 8 1) should be placed in the URL to access this content? Could you please elaborate more on this?
upvoted 1 times
Stann07
1 year, 2 months ago
47 8 1 means page 47, topic 8, question 1
upvoted 1 times
...
...
...
rqb11
Highly Voted 3 years, 10 months ago
Answer is correct: https://docs.microsoft.com/en-us/azure/app-service/overview-managed-identity?context=azure%2Factive-directory%2Fmanaged-identities-azure-resources%2Fcontext%2Fmsi-context&tabs=python#asal
upvoted 29 times
Faizs
3 years, 9 months ago
Absolutely
upvoted 3 times
...
...
DamuKeesh
Most Recent 2 weeks, 3 days ago
Reading and understanding the question is going to take hell of a time.
upvoted 1 times
...
raymond_abcd
1 year ago
When your application is running on an Azure VM with MSI enabled, you can use MSITokenProvider to obtain tokens without directly handling credentials.
upvoted 1 times
...
raymond_abcd
1 year ago
AzureServiceTokenProvider is replaced by Azure.Identity. See: https://learn.microsoft.com/en-us/dotnet/api/overview/azure/app-auth-migration?view=azure-dotnet var tokenCredential = new DefaultAzureCredential(); var accessToken = await tokenCredential.GetTokenAsync( new TokenRequestContext(scopes: new string[] { ResourceId + "/.default" }) { } );
upvoted 7 times
...
devex
1 year, 5 months ago
Answer is correct. TokenCredential class receives a string in the constructor: - https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.storage.auth.tokencredential?view=azure-dotnet#constructors So the answer cannot be MSITokenProvider.GetAuthenticationHeaderAsync which returns an AuthenticationHeaderValue: - https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.management.resourcemanager.fluent.authentication.msitokenprovider.getauthenticationheaderasync AzureServiceTokenProvider.GetAccessTokenAsync on the other hand returns a string: - https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.services.appauthentication.azureservicetokenprovider.getaccesstokenasync
upvoted 2 times
...
adilkhan
2 years ago
https://learn.microsoft.com/en-us/dotnet/api/overview/azure/service-to-service-authentication?view=azure-dotnet Answers are correct
upvoted 2 times
...
OPT_001122
2 years, 2 months ago
AzureServiceTokenProvider GetAccessTokenAsync(...)
upvoted 2 times
...
coffecold
2 years, 4 months ago
This is Microsoft.Azure.Services.AppAuthentication and is since 2019 legacy. Instead use the Azure Identity client library for .NET Azure.Identity using Azure.Identity; using Azure.Security.KeyVault.Secrets; // Create a secret client using the DefaultAzureCredential var client = new SecretClient(new Uri("https://myvault.azure.vaults.net/"), new DefaultAzureCredential()); etc.
upvoted 7 times
edmond
2 years, 2 months ago
Or use ManagedIdentityCredential() if you want to make sure it's using managed identity exclusively
upvoted 3 times
...
...
SivajiTheBoss
2 years, 11 months ago
Correct Answer: - AzureServiceTokenProvider - GetAccessTokenAsync(...)
upvoted 3 times
...
UnknowMan
3 years, 9 months ago
Yep : - AzureServiceTokenProvider - GetAccessTokenAsync
upvoted 5 times
...
Faizs
3 years, 9 months ago
Very correct
upvoted 2 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago