exam questions

Exam AZ-204 All Questions

View all questions & answers for the AZ-204 exam

Exam AZ-204 topic 4 question 51 discussion

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

HOTSPOT -
You are a developer building a web site using a web app. The web site stores configuration data in Azure App Configuration.
Access to Azure App Configuration has been configured to use the identity of the web app for authentication. Security requirements specify that no other authentication systems must be used.
You need to load configuration data from Azure App Configuration.
How should you complete the code? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: AddAzureAppConfiguration -
Load data from App Configuration, code example:
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
webBuilder.ConfigureAppConfiguration((hostingContext, config) =>
{
var settings = config.Build();
config.AddAzureAppConfiguration(options =>
{
Etc.
Box 2: ManagedIdentityCredential
Use managed identities to access App Configuration
If you want to use a user-assigned managed identity, be sure to specify the clientId when creating the ManagedIdentityCredential. config.AddAzureAppConfiguration(options =>
{
options.Connect(new Uri(settings["AppConfig:Endpoint"]), new ManagedIdentityCredential("<your_clientId>"))
});
Full code sample:
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
webBuilder.ConfigureAppConfiguration((hostingContext, config) =>
{
var settings = config.Build();
config.AddAzureAppConfiguration(options =>
options.Connect(new Uri(settings["AppConfig:Endpoint"]), new ManagedIdentityCredential()));
})
.UseStartup<Startup>());
Reference:
https://docs.microsoft.com/en-us/azure/azure-app-configuration/howto-integrate-azure-managed-service-identity?tabs=core5x&pivots=framework- dotnet

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, 6 months ago
Answer is right. "Security requirements specify that no other authentication systems must be used" So you cannot use DefaultAzureCredential, risk of other authentication systems being used. otherwise you could have used DefaultAzureCredential for ease
upvoted 27 times
1CY1
10 months, 3 weeks ago
I also thought that you would use ManagedIdentityCredential because the 'Azure App Configuration' is an internal resource in your subscription and so this is the recommended credential.
upvoted 1 times
...
...
serpevi
Highly Voted 2 years, 7 months ago
Got this in 09/22 , went with the answers given, score 927.
upvoted 15 times
...
yusuf_eb
Most Recent 8 months, 3 weeks ago
Answer seems correct!
upvoted 1 times
...
SSR999
1 year, 3 months ago
https://learn.microsoft.com/en-us/azure/azure-app-configuration/howto-integrate-azure-managed-service-identity?tabs=core6x&pivots=framework-dotnet#use-a-managed-identity
upvoted 1 times
...
junkz
1 year, 5 months ago
second answer is wrong ->https://learn.microsoft.com/en-us/answers/questions/987373/azure-app-configuration-label
upvoted 1 times
Weam
1 year, 5 months ago
However in the question requirement that there should be no other authentication methods tried so we should use ManagedIdentityCredential in specific since we are using web app
upvoted 1 times
...
...
OPT_001122
2 years, 4 months ago
Ans is correct AddAzureAppConfiguration ManagedIdentityCredential
upvoted 6 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