Question 69 of 179 from exam AZ-204: Developing Solutions for Microsoft Azure

Question 69 of 179 from exam AZ-204: Developing Solutions for Microsoft Azure

Question

HOTSPOT - You are developing an ASP.NET Core app that includes feature flags which are managed by Azure App Configuration.

You create an Azure App Configuration store named AppFeatureFlagStore that contains a feature flag named Export.

You need to update the app to meet the following requirements: -> Use the Export feature in the app without requiring a restart of the app.

-> Validate users before users are allowed access to secure resources.

-> Permit users to access secure resources.

How should you complete the code segment? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Hot Area:

Answer Area

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

{
if (env.IsDevelopment())
{
app .UseDeveloperExceptionPage() ;
{
else
{
app.UseExceptionHandler("/Error");
+
app. ~ O35
UseAuthentication
UseStaticFiles
in
UseCookiePolicy
app. ~ Os
UseAuthorizai
UseHttpsRedirection
UseSession
UseCookiePolicy
app. ~ 03

UseAzureAppConfiguration
UseRequestLocalization
UseCors

UseStaticFiles

app.UseEndpoint (endpoints =>
{

endpoints .MapRazorPages();
5
}

Explanations

Answer Area

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

{
if (env.IsDevelopment())
{
app .UseDeveloperExceptionPage() ;
{
else
{
app.UseExceptionHandler("/Error");
+
app. x 03
UseAuthentication |
UseStaticFiles
n
UseCookiePolicy
app. ~ O35
UseAuthorization |
UseHttpsRedirection
UseSession
UseCookiePolicy
app. ~ 03

UseAzureAppConfiguration
UseRequestLocalization
UseCors

UseStaticFiles

app.UseEndpoint (endpoints =>
{

endpoints .MapRazorPages();
5
}

Box 1: UseAuthentication - Need to validate users before users are allowed access to secure resources.

UseAuthentication adds the AuthenticationMiddleware to the specified IApplicationBuilder, which enables authentication capabilities.

Box 2: UseAuthorization - Need to permit users to access secure resources.

UseAuthorization adds the AuthorizationMiddleware to the specified IApplicationBuilder, which enables authorization capabilities.

Box 3: UseStaticFiles - Need to use the Export feature in the app without requiring a restart of the app.

UseStaticFiles enables static file serving for the current request path Reference: https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.builder.iapplicationbuilder?view=aspnetcore-5.0