Microsoft

AZ-204 Free Practice Questions — Page 17

Question 169

HOTSPOT - You are developing a web application that uses the Microsoft Identity platform for user and resource authentication. The web application called several REST APIs. You are implementing various authentication and authorization flows for the web application. You need to validate the claims in the authentication token. Which token type should you use? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-204 question 169
Show Answer
Correct Answer: Identify users using JWT with claims: ID token Identify API permissions using JWT with claims: Access token Long-term access without user interaction: Refresh token XML claims for WS-Federation: SAML token
Explanation:
ID tokens carry user identity claims for the application. Access tokens contain scopes/roles used by APIs to authorize permissions. Refresh tokens allow obtaining new access tokens without further user interaction. SAML tokens provide XML-based claims compatible with WS-Federation.

Question 170

You develop an Azure App Service web app and deploy to a production environment. You enable Application Insights for the web app. The web app is throwing multiple exceptions in the environment. You need to examine the state of the source code and variables when the exceptions are thrown. Which Application Insights feature should you configure?

A. Smart detection
B. Profiler
C. Snapshot Debugger
D. Standard test
Show Answer
Correct Answer: C
Explanation:
To examine the state of source code and variable values at the moment an exception occurs in an Azure App Service, Application Insights Snapshot Debugger should be configured. Snapshot Debugger automatically captures snapshots that include the call stack and local variables when exceptions are thrown, enabling detailed post-mortem debugging without attaching a live debugger.

Question 171

You are developing a Java application to be deployed in Azure. The application stores sensitive data in Azure Cosmos DB. You need to configure Always Encrypted to encrypt the sensitive data inside the application. What should you do first?

A. Create a new container to include an encryption policy with the JSON properties to be encrypted.
B. Create a customer-managed key (CMK) and store the key in a new Azure Key Vault instance.
C. Create a data encryption key (DEK) by using the Azure Cosmos DB SDK and store the key in Azure Cosmos DB.
D. Create an Azure AD managed identity and assign the identity to a new Azure Key Vault instance.
Show Answer
Correct Answer: B
Explanation:
Azure Cosmos DB Always Encrypted is a client-side encryption feature. Before you can encrypt data, you must have a customer-managed key (CMK) stored in Azure Key Vault. This CMK is used to wrap data encryption keys (DEKs) that the application creates later via the Cosmos DB SDK. Only after the CMK exists can you create DEKs and define container encryption policies. Therefore, the first step is creating the CMK in Azure Key Vault.

Question 172

HOTSPOT - You develop new functionality in a web application for a company that provides access to seismic data from around the world. The seismic data is stored in Redis Streams within an Azure Cache for Redis instance. The new functionality includes a real-time display of seismic events as they occur. You need to implement the Azure Cache for Redis command to receive seismic data. How should you complete the command? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-204 question 172
Show Answer
Correct Answer: XREAD BLOCK 0 $
Explanation:
Use XREAD to consume Redis Streams in real time. BLOCK 0 waits indefinitely for new entries, and the $ ID starts reading only messages added after the command begins.

Question 173

You develop an ASP.NET Core app that uses Azure App Configuration. You also create an App Configuration containing 100 settings. The app must meet the following requirements: • Ensure the consistency of all configuration data when changes to individual settings occur. • Handle configuration data changes dynamically without causing the application to restart. • Reduce the overall number of requests made to App Configuration APIs. You must implement dynamic configuration updates in the app. What are two ways to achieve this goal? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.

A. Create and register a sentinel key in the App Configuration store. Set the refreshAll parameter of the Register method to true.
B. Increase the App Configuration cache expiration from the default value.
C. Decrease the App Configuration cache expiration from the default value.
D. Create and configure Azure Key Vault. Implement the Azure Key Vault configuration provider.
E. Register all keys in the App Configuration store. Set the refreshAll parameter of the Register method to false.
F. Create and implement environment variables for each App Configuration store setting.
Show Answer
Correct Answer: A, B
Explanation:
Using a sentinel key with refreshAll set to true ensures consistency by refreshing all configuration values together when changes occur, while still supporting dynamic updates without restarting the app. Increasing the App Configuration cache expiration reduces how frequently the app polls App Configuration, thereby lowering the total number of API requests while still allowing dynamic refresh.

Question 174

DRAG DROP - You develop and deploy a Java application to Azure. The application has been instrumented by using the Application Insights SDK. The telemetry data must be enriched and processed before it is sent to the Application Insights service. You need to modify the telemetry data. Which Application Insights SDK features should you use? To answer, drag the appropriate features to the correct requirements. Each feature 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.

Illustration for AZ-204 question 174
Show Answer
Correct Answer: Reduce the volume of telemetry without affecting statistics: Sampling Enrich telemetry with additional properties or override an existing one: Telemetry initializer Completely replace or discard a telemetry item: Telemetry processor
Explanation:
Sampling reduces telemetry volume while preserving statistical accuracy. Telemetry initializers add or modify properties on telemetry before sending. Telemetry processors can filter, modify, or discard telemetry items entirely.

Question 175

HOTSPOT - You develop and deploy the following staticwebapp.config.json file to the app_location value specified in the workflow file of an Azure Static Web app: For each of the following statements, select Yes if the statement is true. Otherwise, select No. NOTE: Each correct selection is worth one point.

Illustration for AZ-204 question 175 Illustration for AZ-204 question 175
Show Answer
Correct Answer: No Yes Yes No
Explanation:
1) Unauthenticated requests receive a 401 which is overridden to redirect to /.auth/login/aad, not GitHub (GitHub is only used when routing to /login). 2) /images/*.{png,jpg,gif} is excluded from navigation fallback, so a missing file returns 404. 3) GET requests to /api/* are allowed for authenticated users in the registeredusers role. 4) Authenticated users without the role get 403, and unauthenticated users are redirected (401 overridden), not served a 401.

Question 176

HOTSPOT - You develop an application that sells AI generated images based on user input. You recently started a marketing campaign that displays unique ads every second day. Sales data is stored in Azure Cosmos DB with the date of each sale being stored in a property named ‘whenFinished’. The marketing department requires a view that shows the number of sales for each unique ad. You need to implement the query for the view. How should you complete the query? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-204 question 176
Show Answer
Correct Answer: SELECT count(c.whenFinished), DateTimeBin(c.whenFinished, 'day', 2) FROM c GROUP BY DateTimeBin(c.whenFinished, 'day', 2)
Explanation:
The view must show the number of sales, so COUNT is required. Unique ads change every second day, so sales are grouped into 2-day bins using DateTimeBin on whenFinished. The same DateTimeBin expression must appear in both SELECT and GROUP BY.

Question 177

HOTSPOT - You are developing a content management application for technical manuals. The application is deployed as an Azure Static Web app. Authenticated users can view pages under/manuals but only contributors can access the page /manuals/new.html. You need to configure the routing for the web app. How should you complete the configuration? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-204 question 177
Show Answer
Correct Answer: route: /manuals/new.html allowedRoles: contributors route: /manuals* allowedRoles: authenticated
Explanation:
Static Web Apps routes are evaluated top-down and stop at the first match. The more specific route (/manuals/new.html) must come first to restrict it to contributors. The broader /manuals* route then allows any authenticated user to access other manual pages.

Question 178

HOTSPOT - You develop several Azure Functions app functions to process JSON documents from a third-party system. The third-party system publishes events to Azure Event Grid to include hundreds of event types, such as billing, inventory, and shipping updates. Events must be sent to a single endpoint for the Azure Functions app to process. The events must be filtered by event type before processing. You must have authorization and authentication control to partition your tenants to receive the event data. You need to configure Azure Event Grid. Which configuration should you use? To answer, select the appropriate values in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-204 question 178
Show Answer
Correct Answer: Third-party system endpoint to send events: event domain Azure Functions app endpoint to handle filtered events: event subscription
Explanation:
Event domains provide a single publish endpoint with per-topic authentication and authorization, enabling tenant partitioning. Event subscriptions route events to handlers like Azure Functions and support filtering by event type before processing.

$19

Get all 447 questions with detailed answers and explanations

  • Instant download HTML + PDF delivered the moment payment clears.
  • Secure Stripe checkout we never see or store your card details.
  • 7-day refund if files are defective see our refund policy.