00:20:00

Microsoft Azure Developer Associate Practice Test (AZ-204)

Use the form below to configure your Microsoft Azure Developer Associate Practice Test (AZ-204). The practice test can be configured to only include certain exam objectives and domains. You can choose between 5-100 questions and set a time limit.

Logo for Microsoft Azure Developer Associate AZ-204
Questions
Number of questions in the practice test
Free users are limited to 20 questions, upgrade to unlimited
Seconds Per Question
Determines how long you have to finish the practice test
Exam Objectives
Which exam objectives should be included in the practice test

Microsoft Azure Developer Associate AZ-204 Information

The Microsoft Azure Developer Associate (AZ-204) certification is a crucial credential for cloud developers specializing in the Microsoft Azure ecosystem. This exam is designed for professionals who are responsible for all phases of the development lifecycle, including gathering requirements, design, development, deployment, security, maintenance, performance tuning, and monitoring. Candidates should have 1-2 years of professional development experience, including hands-on experience with Microsoft Azure. The exam validates a developer's proficiency in leveraging Azure's tools, SDKs, and APIs to build and maintain cloud applications and services.

The AZ-204 exam assesses a broad set of skills across five primary domains. These areas include developing Azure compute solutions (25-30%), developing for Azure storage (15-20%), implementing Azure security (15-20%), monitoring, troubleshooting, and optimizing Azure solutions (5-10%), and connecting to and consuming Azure services and third-party services (20-25%). The exam itself consists of 40-60 questions and has a duration of about 100 minutes. The question formats can vary, including multiple-choice, scenario-based questions, and drag-and-drop tasks.

The Value of Practice Exams in Preparation

A critical component of a successful study plan for the AZ-204 exam is the use of practice tests. Taking practice exams offers several key benefits that go beyond simply memorizing facts. They help you become familiar with the style, wording, and difficulty of the questions you are likely to encounter on the actual exam. This familiarity can help reduce anxiety and improve time management skills during the test.

Furthermore, practice exams are an excellent tool for self-assessment. They allow you to gauge your readiness, identify areas of weakness in your knowledge, and focus your study efforts accordingly. By reviewing your answers, especially the incorrect ones, you can gain a deeper understanding of how different Azure services work together to solve real-world problems. Many candidates find that simulating exam conditions with timed practice tests helps build the confidence needed to think clearly and methodically under pressure. Microsoft itself provides a practice assessment to help candidates prepare and fill knowledge gaps, increasing the likelihood of passing the exam.

Microsoft Azure Developer Associate AZ-204 Logo
  • Free Microsoft Azure Developer Associate AZ-204 Practice Test

  • 20 Questions
  • Unlimited
  • Develop Azure compute solutions
    Develop for Azure storage
    Implement Azure security
    Monitor and troubleshoot Azure solutions
    Connect to and consume Azure services and third-party services
Question 1 of 20

You are developing an ASP.NET Core Web API protected with the Microsoft Identity platform (v2 endpoint). Client apps will call the API either on behalf of a signed-in user (delegated flow) or as a daemon service (client-credentials flow). The API must programmatically verify the permission conveyed in the token. Which claim should the API evaluate in each scenario?

  • Delegated flow - check the aud claim; client-credentials flow - check the appid claim.

  • Delegated flow - check the groups claim; client-credentials flow - check the scope claim.

  • Delegated flow - check the scp (scope) claim; client-credentials flow - check the roles claim.

  • Delegated flow - check the roles claim; client-credentials flow - check the scp (scope) claim.

Question 2 of 20

You are building a .NET 6 Web API that will be called by a single-page application (SPA) registered in Microsoft Entra ID. The SPA obtains tokens from the v2.0 endpoint by requesting the scope api:///Weather.Read. During testing, the Web API rejects every call with the error "The issuer 'https://login.microsoftonline.com//v2.0' is not valid." You need to configure the Web API's app registration so that it accepts the incoming v2.0 access tokens without changing any code in the SPA.

Which manifest property should you modify, and what value should it have?

  • Remove accessTokenAcceptedVersion (leave it null).

  • Set oauth2AllowImplicitFlow to true.

  • Add the SPA's client ID to the knownClientApplications array.

  • Set accessTokenAcceptedVersion to 2.

Question 3 of 20

You manage an Azure Container Registry (ACR) named "contosoacr" in the resource group "dev-rg". You must publish the public Docker Hub image "nginx:1.25" to the registry as "web/nginx:stable" without first downloading the image to your workstation. Which Azure CLI command accomplishes this goal?

  • docker pull nginx:1.25 && docker tag nginx:1.25 contosoacr.azurecr.io/web/nginx:stable && docker push contosoacr.azurecr.io/web/nginx:stable

  • az acr repository copy --name contosoacr --source nginx:1.25 --image web/nginx:stable --resource-group dev-rg

  • az acr build --registry contosoacr --image web/nginx:stable docker.io/library/nginx:1.25 --resource-group dev-rg

  • az acr import --name contosoacr --source docker.io/library/nginx:1.25 --image web/nginx:stable --resource-group dev-rg

Question 4 of 20

You are developing an Azure Function that uses Application Insights. Inside a catch block you must send the caught exception together with a string property named CustomerId and a numeric metric named ElapsedMs. A TelemetryClient instance named telemetryClient is already available. Which method call should you use to meet the requirement?

  • telemetryClient.TrackException(ex, new Dictionary<string,string>{{"CustomerId", customerId}}, new Dictionary<string,double>{{"ElapsedMs", elapsedMs}});

  • telemetryClient.TrackTrace("Exception", SeverityLevel.Error, new Dictionary<string,string>{{"CustomerId", customerId}});

  • telemetryClient.TrackException(new ExceptionTelemetry(ex) { Properties = { {"CustomerId", customerId} } });

  • telemetryClient.TrackEvent("ExceptionCaught", new Dictionary<string,string>{{"CustomerId", customerId}}, new Dictionary<string,double>{{"ElapsedMs", elapsedMs}});

Question 5 of 20

You are building a console application that runs as a background service and must call a custom web API secured by Microsoft Entra ID. The API exposes a scope named "Tasks.Read". The console app must obtain an access token without any user interaction. What should you configure to enable the console app to receive a valid token for the API?

  • Add the console app's managed identity to an Azure AD group that is assigned the "Tasks.Read" scope and rely on group claims in the token.

  • Register the console app as a public client, configure implicit grant, and request an access token directly from the authorization endpoint.

  • Create an application permission for "Tasks.Read", assign that permission to the console app, grant tenant-wide admin consent, and request the token by using the OAuth 2.0 client credentials flow.

  • Expose "Tasks.Read" only as a delegated permission, require users to grant consent individually, and obtain the token through the authorization code flow.

Question 6 of 20

You need to provision a new Azure App Service Web App named "contoso-api" for a .NET 7.0 application. The web app must run on Linux and be placed in the existing resource group "RG1" and the existing App Service plan "asp-linux" (located in the same resource group). Which Azure CLI command meets the requirements?

  • az webapp create --resource-group RG1 --plan asp-linux --name contoso-api --runtime "DOTNETCORE|7.0" --os-type Windows

  • az webapp create --resource-group RG1 --plan asp-linux --name contoso-api --runtime "DOTNETCORE|7.0" --os-type Linux

  • az webapp create --resource-group RG1 --name contoso-api --runtime "DOTNETCORE|7.0" --os-type Linux

  • az webapp create --resource-group RG1 --plan asp-linux --name contoso-api --runtime "DOTNET:7.0" --os-type Linux

Question 7 of 20

Your team needs to monitor the public HTTPS endpoint of an ASP.NET Core API using Application Insights. The test must validate the SSL certificate, allow you to specify a custom HTTP header, and run from multiple Azure locations without writing any code. Which type of availability test should you configure?

  • Standard test

  • URL ping test

  • Custom TrackAvailability test

  • Multi-step web test

Question 8 of 20

You have an Azure App Service for Linux that runs a custom container image stored in Azure Container Registry (ACR). Developers frequently push new versions of the image by overwriting the existing "latest" tag. You must ensure the web app automatically pulls and runs the updated image each time the tag is pushed, without any manual steps. Which action should you take?

  • Package the application code into a zip file and deploy it with Run-From-Package.

  • Enable Continuous Deployment for the ACR image in Deployment Center, allowing a registry webhook to redeploy the web app automatically.

  • Set the app setting WEBSITES_CONTAINER_START_TIME_LIMIT to 0 so App Service re-pulls the container image each time it starts.

  • Create a staging deployment slot and configure autoswap to production whenever the slot restarts.

Question 9 of 20

You use a C# timer-triggered Azure Function with the CRON expression '0 0 */4 * * *' so it runs every four hours. The function must also execute once immediately when the function app starts. Which configuration change accomplishes this?

  • Enable the AlwaysOn setting on the Function App in Azure portal.

  • Create an application setting named WEBSITE_TIME_TRIGGER with the value Startup.

  • Add the parameter RunOnStartup = true to the TimerTrigger attribute.

  • Set useMonitor to false for the timer extension in host.json.

Question 10 of 20

You are developing a multi-tenant ASP.NET Core Web API called Inventory API protected by Microsoft Entra ID. Client apps access the API by using the OAuth 2.0 client-credentials flow. An application role "inventory.read.all" is defined in the API registration and assigned to the clients. When validating incoming access tokens, which claim and value should you verify to authorize read operations?

  • Check that the appid claim equals "inventory.read.all".

  • Check that the aud claim equals "inventory.read.all".

  • Check that the roles claim includes "inventory.read.all".

  • Check that the scp claim equals "inventory.read.all".

Question 11 of 20

You are developing a telemetry ingestion solution that uses an Azure Event Hubs Standard namespace. Devices publish thousands of events per second. Auditors require an immutable copy of every raw event in Azure Storage for at least 90 days to allow replay. You must meet the requirement with minimal changes to producer and consumer code. What should you do?

  • Create an Azure Function that is triggered by the Event Hub and writes each event payload to Azure Blob Storage.

  • Enable diagnostic settings on the Event Hubs namespace and send the diagnostic logs to Azure Storage.

  • Configure an Azure Stream Analytics job that reads from the Event Hub and outputs the stream to Azure Blob Storage.

  • Enable Event Hubs Capture and set the destination to an Azure Storage container that has a 90-day lifecycle deletion policy.

Question 12 of 20

You are building an ASP.NET Core web app that authenticates to a service by using a client certificate. The certificate is stored in an Azure Key Vault named ContosoVault and was imported as an exportable PFX file. At start-up you must load the certificate with its private key into an X509Certificate2 object in memory. A DefaultAzureCredential instance named credential is already available. Which C# approach should you implement?

  • Use Azure CLI inside the app to run az keyvault certificate download and load the downloaded file into an X509Certificate2 object.

  • Instantiate a SecretClient with the vault URI and credential, call GetSecretAsync("clientCert"), convert the Value to byte[], then create the X509Certificate2 object from the byte array.

  • Instantiate a CertificateClient, call GetCertificateAsync("clientCert"), and pass the returned Certificate.Content bytes to the X509Certificate2 constructor.

  • Instantiate a KeyClient, call GetKeyAsync("clientCert"), extract the key material, and build the X509Certificate2 object from it.

Question 13 of 20

Your company runs an Azure Cosmos DB account that has East US as the single write region and West Europe added as a read region. A microservice that runs only in West Europe must read documents that it previously wrote and must see those writes immediately, but it can tolerate other clients' updates becoming visible later. To keep latency and request units (RU) usage as low as possible, which consistency level should the microservice specify on its SDK requests?

  • Strong consistency

  • Consistent Prefix consistency

  • Eventual consistency

  • Session consistency

Question 14 of 20

You are developing a .NET 8 isolated-process Azure Function that runs on the Consumption plan. The function needs a SQL Database connection string. The value must be changeable without code redeployment and must rotate centrally while remaining inaccessible to other developers. You want to minimize code changes and follow Azure guidance for configuration and secret management. Which approach should you use?

  • Add the connection string to the local.settings.json file and deploy the file with the function code.

  • Save the connection string as a plain key-value in Azure App Configuration and load it at runtime with the AzureAppConfiguration client library.

  • Create an application setting for the function app and paste the connection string as its value.

  • Store the connection string as a secret in Azure Key Vault and reference it in the function app's application settings by using a Key Vault reference syntax.

Question 15 of 20

You are deploying a new Azure API Management (APIM) instance by using an ARM template. The template contains the following snippet:

"sku": {
  "name": "Consumption",
  "capacity": 2
}

After running the deployment, the template validation fails with the error "Property capacity is not allowed".

To complete the deployment successfully while keeping the billing model that charges per execution and scales automatically, what should you do?

  • Change the sku.name value to Developer and keep capacity set to 1.

  • Keep the sku settings and add the property "autoScale": "enabled" to the template.

  • Change the sku.name value to Basic and keep capacity set to 2.

  • Remove the capacity property (or set it to 0) and redeploy the Consumption tier.

Question 16 of 20

Your team recently added a FeatureToggleButton custom event to track how users enable a new capability in your ASP.NET Core web app. The app is already sending telemetry to Application Insights. Product owners want to know, without writing any KQL, how many unique users clicked this event during the last 24 hours and how many of those users were new versus returning. Which built-in usage analytics blade should you use to get this information most quickly?

  • Users

  • Events

  • Live Metrics Stream

  • Sessions

Question 17 of 20

You build a .NET application that uses the ChangeFeedProcessor class (SDK v3) to react to inserts and updates in an Azure Cosmos DB container. The processor will run in several Kubernetes pods for horizontal scale. Which configuration ensures that every logical partition range from the change feed is processed by only one pod at any given time, preventing concurrent duplicate processing across pods?

  • Invoke CheckpointAsync after processing every item to write manual checkpoints.

  • Configure all pods to use the same lease container located in the same Cosmos DB account.

  • Assign a unique instance name to each pod when building the processor.

  • Set the processor's start time to DateTime.UtcNow each time it starts.

Question 18 of 20

You are creating an Azure Monitor metric alert that is triggered when an Application Insights URL ping availability test fails from at least two test locations within a 5-minute window. The on-call engineer must receive an SMS notification each time the alert fires. Which change to the alert configuration guarantees that the text message is sent?

  • Select the Send SMS option on the Availability Test blade and save the test configuration.

  • Convert the metric alert to a log alert that uses a KQL query against trackAvailability telemetry.

  • Add the engineer's phone number under the Notification settings of the Application Insights resource.

  • Attach an Azure Monitor action group that contains an SMS receiver to the metric alert and leave the action group enabled.

Question 19 of 20

Your background service runs without user interaction and must periodically list all users in your Azure AD tenant by calling Microsoft Graph. Using the Microsoft Identity platform, which OAuth 2.0 grant type and Microsoft Graph permission type should you implement to meet the requirement?

  • Device code grant with a delegated permission such as Group.Read.All

  • Implicit grant with an application permission such as Directory.Read.All

  • Client credentials grant with an application permission such as User.Read.All

  • Authorization code grant with a delegated permission such as User.Read.All

Question 20 of 20

You are developing an order-processing application that publishes messages to an Azure Service Bus queue. Network interruptions can occasionally cause the sender to retry the same message. The consumer must process each order exactly once even if duplicates are sent within 10 minutes. What should you configure on the queue?

  • Increase the queue's lock duration to 10 minutes.

  • Set the queue's MaxDeliveryCount property to 1 and enable dead-lettering on expiration.

  • Enable duplicate detection and set the duplicate detection history window to 10 minutes.

  • Require sessions and set the session idle timeout to 10 minutes.