Microsoft

AZ-204 Free Practice Questions — Page 3

Question 24

You are developing a microservices-based application that uses Azure Container Apps. The application consists of several containerized services that handle tasks, such as processing orders, managing inventory, and generating reports. You deploy two microservices named serviceA and serviceB to support managing inventory. You have the following requirements: • serviceA and serviceB must publish events to a single Azure Event Hub by using the Event Hubs SDK. • serviceA must publish 1,000 events per second. • serviceB must publish 3,000 events per second. • Costs must be minimized. You need to support the publishing of events. What should you do?

A. Create four partitions. Update serviceA to use one partition and serviceB to use three partitions.
B. Enable and configure Azure Event Hubs Capture.
C. Create an Azure Event Hubs dedicated cluster. Configure the capacity units to one and the scaling units to two.
D. Create and configure an Azure Schema Registry in Event Hubs. Update serviceA and serviceB to validate message schemas.
E. Create four consumer groups. Update serviceA to use one consumer group and serviceB to use three consumer groups.
Show Answer
Correct Answer: A
Explanation:
Azure Event Hubs ingestion throughput scales with partitions and throughput units. In the Standard tier, each partition supports up to ~1,000 events per second (or 1 MB/s). To handle a combined 4,000 events per second at minimum cost, you should create four partitions. Assigning one partition’s worth of throughput to serviceA (1,000 events/sec) and three partitions’ worth to serviceB (3,000 events/sec) satisfies the throughput requirements without unnecessary features or higher-cost options. Other options do not increase ingress throughput or would significantly increase cost.

Question 25

DRAG DROP - You create an Azure subscription. You then create an Azure resource group. You plan to create a containerized task that will run as an Azure Container App in regular intervals. You need to automate the process of creating the task in the resource group by using Azure CLI commands. Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.

Illustration for AZ-204 question 25
Show Answer
Correct Answer: az provider register az containerapp env create az containerapp job create
Explanation:
In a new subscription, required resource providers must be registered first. Azure Container Apps jobs run inside a Container Apps environment, which must exist before creating the job. Creating the job defines the scheduled containerized task; starting it is optional and not required for automation setup.

Question 26

You are developing a microservices-based application that uses Azure Container Apps. The application consists of several containerized services that handle tasks, such as processing orders, managing inventory, and generating reports. You deploy a new revision of the processing orders app. Processing orders must be triggered by a web request and must always be available based on incoming web requests. You need to validate that the replica is ready to handle incoming requests. What should you implement?

A. HTTP readiness probe
B. TCP readiness probe
C. HTTP startup probe
D. TCP liveness probe
E. HTTP liveness probe
Show Answer
Correct Answer: A
Explanation:
The requirement is to validate that a replica is ready to handle incoming web requests. A readiness probe controls whether traffic is sent to a container, and an HTTP readiness probe is appropriate for web-based services because it checks an HTTP endpoint to confirm the app can serve requests. Liveness and startup probes serve different purposes, and TCP probes are less specific for HTTP services.

Question 27

You have a workspace-based Azure Application Insights resource named Insights1 and an Azure App Service Web App named App1. Insights1 collects telemetry generated by App1. You plan to evaluate the alerting functionality of the availability testing that is enabled for App1 by taking it offline for 50 minutes. You create a standard availability test for App1, set its frequency to 15 minutes, and set its alert status to Enabled. You need to assess the number of alerts that you should expect by taking App1 offline for 50 minutes. How many alerts should you expect?

A. 1
B. 2
C. 3
D. 4
Show Answer
Correct Answer: A
Explanation:
Standard availability tests in Application Insights generate a single alert per availability incident. With a 15-minute test frequency, the test will detect consecutive failures while the app is offline, but the alert fires only once when the outage is detected and does not repeat every interval. No additional alert is triggered until the app recovers and a new incident occurs. Therefore, taking the app offline for 50 minutes results in one alert.

Question 28

HOTSPOT - You are developing a microservices-based application by using Azure Container Apps. The application consists of several containerized services that handle tasks, such as processing orders, managing inventory, and generating reports. Processing orders has the following requirements: • Orders must be triggered by a web request. • Additional replicas must be added when the total number of web requests exceeds 300 for at least 15 seconds. • Processing orders must always be available based on incoming web requests. • Costs must be minimized for the Azure Container Apps instance. You need to configure scaling. How should you complete the CLI command? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-204 question 28
Show Answer
Correct Answer: create 0
Explanation:
Use `az containerapp create` to deploy the app. Set `--min-replicas 0` to minimize cost while still allowing HTTP-triggered scale-out; Azure Container Apps can scale from zero on incoming web requests, meeting availability and scaling requirements.

Question 29

Case study - This is a case study. Case studies are not timed separately. You can use as much exam time as you would like to complete each case. However, there may be additional case studies and sections on this exam. You must manage your time to ensure that you are able to complete all questions included on this exam in the time provided. To answer the questions included in a case study, you will need to reference information that is provided in the case study. Case studies might contain exhibits and other resources that provide more information about the scenario that is described in the case study. Each question is independent of the other questions in this case study. At the end of this case study, a review screen will appear. This screen allows you to review your answers and to make changes before you move to the next section of the exam. After you begin a new section, you cannot return to this section. To start the case study - To display the first question in this case study, click the Next button. Use the buttons in the left pane to explore the content of the case study before you answer the questions. Clicking these buttons displays information such as business requirements, existing environment, and problem statements. When you are ready to answer a question, click the Question button to return to the question. Background - Fourth Coffee is a global coffeehouse chain and coffee company recognized as one of the world’s most influential coffee brands. The company is renowned for its specialty coffee beverages, including a wide range of espresso-based drinks, teas, and other beverages. Fourth Coffee operates thousands of stores worldwide. Current environment - The company is developing cloud-native applications hosted in Azure. Corporate website - The company hosts a public website located at http://www.fourthcoffee.com/. The website is used to place orders as well as view and update inventory items. Inventory items - In addition to its core coffee offerings, Fourth Coffee recently expanded its menu to include inventory items such as lunch items, snacks, and merchandise. Corporate team members constantly update inventory. Users can customize items. Corporate team members configure inventory items and associated images on the website. Orders - Associates in the store serve customized beverages and items to customers. Orders are placed on the website for pickup. The application components process data as follows: 1. Azure Traffic Manager routes a user order request to the corporate website hosted in Azure App Service. 2. Azure Content Delivery Network serves static images and content to the user. 3. The user signs in to the application through a Microsoft Entra ID for customers tenant. 4. Users search for items and place an order on the website as item images are pulled from Azure Blob Storage. 5. Item customizations are placed in an Azure Service Bus queue message. 6. Azure Functions processes item customizations and saves the customized items to Azure Cosmos DB. 7. The website saves order details to Azure SQL Database. 8. SQL Database query results are cached in Azure Cache for Redis to improve performance. The application consists of the following Azure services: Requirements - The application components must meet the following requirements: • Azure Cosmos DB development must use a native API that receives the latest updates and stores data in a document format. • Costs must be minimized for all Azure services. • Developers must test Azure Blob Storage integrations locally before deployment to Azure. Testing must support the latest versions of the Azure Storage APIs. Corporate website - • User authentication and authorization must allow one-time passcode sign-in methods and social identity providers (Google or Facebook). • Static web content must be stored closest to end users to reduce network latency. Inventory items - • Customized items read from Azure Cosmos DB must maximize throughput while ensuring data is accurate for the current user on the website. • Processing of inventory item updates must automatically scale and enable updates across an entire Azure Cosmos DB container. • Inventory items must be processed in the order they were placed in the queue. • Inventory item images must be stored as JPEG files in their native format to include exchangeable image file format (data) stored with the blob data upon upload of the image file. • The Inventory Items API must securely access the Azure Cosmos DB data. Orders - • Orders must receive inventory item changes automatically after inventory items are updated or saved. Issues - • Developers are storing the Azure Cosmos DB credentials in an insecure clear text manner within the Inventory Items API code. • Production Azure Cache for Redis maintenance has negatively affected application performance. You need to securely access inventory items when developing the Inventory Items API. What are three possible ways to achieve this goal? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point.

A. Create a SQL role definition under the Azure Cosmos DB account. Create a user-assigned managed identity and assign the identity to the function app. Assign the user assigned managed identity the SQL role definition. Update the function app code to implement the DefaultAzureCredential class and reference the user-assigned managed identity.
B. Create a SQL role definition under the Azure Cosmas DB account. Assign the role to the function apps system-assigned managed identity. Programmatically access the Azure Cosmos DB keys from the function app.
C. Create a custom Microsoft Entra role. Assign the custom roe to the Azure Cosmos DB account Update the function app to use certificate-based authentication.
D. Create a custom Microsoft Entra role. Assign the custom role to Azure Key Vault. Assign the custom role to the function app. Reference the custom role in the function app code when accessing Azure Key Vault values.
E. Create a system-assigned managed ident for the function app with read access to secrets in Azure Key Vault. Store the Azure Cosmos DB primary key and UR in Azure Key Vaults secrets. Use function app settings to reference the secret values.
Show Answer
Correct Answer: A, B, E
Explanation:
The goal is to securely access Azure Cosmos DB without storing credentials in clear text. A is correct because it uses Azure Cosmos DB RBAC with a managed identity and DefaultAzureCredential, eliminating the need for keys and providing secure, native authentication. B is also a valid solution because it assigns a Cosmos DB SQL role to the function app’s system-assigned managed identity. Although the application still retrieves keys programmatically, access to those keys is secured through Azure AD and not hard-coded, addressing the stated issue of clear-text credentials. E is correct because it secures the Cosmos DB URI and primary key in Azure Key Vault and uses a managed identity to retrieve them at runtime, removing secrets from source code and configuration files. Options C and D do not provide a complete or appropriate solution for securely accessing Cosmos DB in this scenario.

Question 30

You have an Azure subscription that contains an Application Insights resource named AI1 and an Azure App Service web app named App1. You create a Standard availability test in AI1. You set its URL to point to App1. You need to ensure that any failed tests generate email notifications to the owners of the subscription. What should you do?

A. Create an action group.
B. Create an alert rule.
C. Enable the test.
D. Enable the alert.
Show Answer
Correct Answer: B
Explanation:
Email notifications for failed availability tests are generated by Azure Monitor alerts. You must create an alert rule that monitors the Application Insights availability test and targets the subscription owners. Action groups only define how notifications are sent, but without an alert rule nothing triggers them. Standard availability tests already exist; the missing requirement is the alert rule.

Question 31

You develop an ASP. Net Core application by integrating the Application Insights SDK into your solution. The application sends a very high rate of telemetry in a short time interval. You observe a reduced number of events, traces, and metrics being recorded and increased error rates for telemetry ingestion. You need to reduce telemetry traffic, data costs, and storage costs while preserving a statistically correct analysis of application telemetry data. Your solution must ensure that you will be able to correlate HTTP request and response data. What should you do?

A. Configure a Log Analytics workspace data collection rule (DCR). Use a Kusto Query Language (KQL) statement to filter incoming data.
B. Disable adaptive sampling. Enable and configure the fixed-rate sampling module.
C. Set a daily cap on the Log Analytics workspace. Create an Activity log alert rule.
D. Configure the TelemetryConfiguration object in the instrumented code. Increase the metric aggregation interval to 15 minutes.
Show Answer
Correct Answer: B
Explanation:
The problem is telemetry throttling due to very high ingestion rates. To reduce telemetry volume and costs while preserving statistically valid analysis and full correlation between HTTP requests and dependent telemetry, sampling must be applied at the SDK level. Fixed-rate sampling gives predictable control over telemetry volume and preserves end-to-end correlation for sampled operations. Other options either filter data after ingestion, cap data (causing data loss), or change aggregation timing without reducing telemetry traffic.

Question 32

HOTSPOT - You have an Azure App Service web app named App1. App1 has Application Insights enabled. You plan to review the configuration of telemetry sampling for Application Insights of App1. You need to author an analytics query that will return the sampling rate. How should you complete the provided query? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-204 question 32
Show Answer
Correct Answer: requests itemCount
Explanation:
Telemetry sampling in Application Insights is calculated using the itemCount field, which represents how many original telemetry items each sampled record stands for. Querying the requests table and summarizing 100 / avg(itemCount) returns the retained (sampling) percentage.

Question 33

HOTSPOT - You have a web app named App1 hosted on you, on-premises web server. You plan to use the Application Insights JavaScript SDK to implement client-side Real User Monitoring (RUM) of individual pages of App1. You need to author the script element that will be added to each of the pages. What should you set for the value of src and cfg keys in the script element of each page? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-204 question 33
Show Answer
Correct Answer: src: URL to download the SDK from cfg: Application Insights connection string
Explanation:
The JavaScript SDK must be loaded from the Application Insights CDN using the src value. The cfg value provides the configuration, specifically the connection string, so telemetry is sent to the correct Application Insights resource.

$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.