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

Free Preview

This test is a free preview, no account required.
Subscribe to unlock all content, keep track of your scores, and access AI features!

Question 1 of 20

Your production Web App runs on Azure App Service for Windows in the Premium V2 tier. During spikes in traffic, requests occasionally time out. You suspect a thread-pool deadlock and need a full memory and thread dump for offline analysis, but you must avoid recycling the worker process to meet the SLA. Which built-in App Service feature lets you capture the dump directly from the Azure portal without restarting the app?

  • Application Insights Profiler trace

  • Diagnose and solve problems - Collect Memory Dump tool

  • Kudu WebSSH console

  • Log Stream with detailed error logging enabled

Question 2 of 20

You have a general-purpose v2 storage account that stores log files in a container named logs. To reduce costs, the files must automatically move to the Archive access tier 90 days after they were last modified. When creating an object lifecycle management rule, which JSON action and condition should you add to the rule definition to meet the requirement?

  • "actions": { "baseBlob": { "tierToArchive": { "daysAfterLastAccessTimeGreaterThan": 90 } } }

  • "actions": { "baseBlob": { "tierToCool": { "daysAfterModificationGreaterThan": 90 } } }

  • "actions": { "baseBlob": { "tierToArchive": { "daysAfterModificationGreaterThan": 90 } } }

  • "actions": { "snapshot": { "tierToArchive": { "daysAfterModificationGreaterThan": 90 } } }

Question 3 of 20

You are developing a single-page JavaScript application (SPA) that needs to call a custom web API protected by Microsoft Entra ID. The solution must use an OAuth 2.0 flow that never transmits a client secret, returns tokens containing user claims, and works with Conditional Access and modern browser protections. Which grant type should you implement?

  • Resource-owner-password-credentials grant

  • Client-credentials grant

  • Implicit grant

  • Authorization code flow with PKCE

Question 4 of 20

You run an on-demand data-processing task in Azure Container Instances. The task completes in roughly 15 minutes. After a successful run (exit code 0), the container should stop so that billing ends. If the task fails (non-zero exit code), the container must restart automatically. Which restart policy should you set when creating the container group?

  • Always

  • OnFailure

  • Never

  • UnlessStopped

Question 5 of 20

You have the source code and a Dockerfile in the current directory on your workstation. The workstation lacks Docker engine and has limited CPU resources. You need to build the image in Azure and push it to an Azure Container Registry named contosoacrdemo, tagging the resulting image as web:v1. Which Azure CLI command should you run?

  • docker build -t contosoacrdemo.azurecr.io/web:v1 .

  • az acr build --registry contosoacrdemo --image web:v1 .

  • az acr task create --registry contosoacrdemo --name buildweb --image web:v1 --context .

  • az container create --registry-login-server contosoacrdemo.azurecr.io --image web:v1 .

Question 6 of 20

An Azure App Service web app named contoso-api uses two deployment slots: production and staging. The configuration contains an app setting APPINSIGHTS_INSTRUMENTATIONKEY and a connection string DefaultConnection that currently points to the production database. You plan to swap staging with production. After the swap, each slot must continue using its existing database. What should you do before starting the swap?

  • Enable auto-swap on the staging slot.

  • Mark the DefaultConnection connection string as a slot setting.

  • Mark the APPINSIGHTS_INSTRUMENTATIONKEY app setting as a slot setting.

  • Configure traffic routing to send 20 % of traffic to the staging slot.

Question 7 of 20

You are managing an Azure App Service Web App hosted in a Standard tier App Service plan. To reduce costs, you must configure autoscale so that the plan runs between one and five instances based on average CPU utilization. Autoscale must continue to function even if the web app is stopped for maintenance. In the Azure portal, on which resource should you configure the autoscale profile?

  • The App Service plan that hosts the web app

  • The web app resource itself

  • The Azure Monitor autoscale setting applied at the resource group level

  • The Application Insights resource linked to the web app

Question 8 of 20

You need to watch a production ASP.NET Core web app for service degradation while rolling out a critical fix. The solution must let you see incoming request rate, average server response time, and any failed requests within a few seconds, without waiting for data to appear in the Logs blade. Which Application Insights feature should you use?

  • An Application Insights workbook

  • A Kusto query in the Logs blade

  • A metric-based alert rule targeting server response time

  • Live Metrics Stream

Question 9 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?

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

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

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

Question 10 of 20

You have an Azure Container App named orders-api that was created by using the default settings. You plan to deploy an updated container image and gradually shift 20 percent of incoming traffic to the new revision while the remaining 80 percent continues to use the current revision. Before deploying the new image, which change must you make to the existing container app to support this traffic-splitting strategy?

  • Enable the Dapr sidecar and add a component that defines canary percentages.

  • Change the revisionMode setting of orders-api to multiple.

  • Create a second container app for the new image and configure an Azure Traffic Manager profile to distribute 20 percent of traffic to it.

  • Add a new autoscale rule with the canary policy type.

Question 11 of 20

You deploy a Linux-based Azure App Service Web App that runs a custom image stored in a private Azure Container Registry. The image tag is set to "webapi:prod". You push further updates to the same tag several times a week. You need the web app to redeploy automatically each time the tag is updated, without changing the container configuration manually. Which setting should you configure on the web app?

  • Add an application setting named WEBSITE_PULL_IMAGE_ON_STARTUP with the value true.

  • Add an application setting named DOCKER_ENABLE_CI with the value true.

  • Add an application setting named WEBSITES_PORT with the value 80.

  • Enable Always On in the Configuration page.

Question 12 of 20

You are developing an ASP.NET Core 6.0 web API that will be deployed to Azure App Service. The app has a system-assigned managed identity. A secret named DbConnection is stored in Azure Key Vault. You need to load the secret into the app's configuration at startup without hard-coding any credentials. Which code statement should you add?

  • builder.Configuration.AddEnvironmentVariables("DbConnection");

  • builder.Configuration.AddAzureKeyVault(new Uri(keyVaultUrl), new DefaultAzureCredential());

  • builder.Configuration.AddUserSecrets();

  • builder.Configuration.AddJsonFile("Secrets.json", optional: false, reloadOnChange: true);

Question 13 of 20

Your company stores container images in a private Azure Container Registry (ACR) named contosoreg. You need to run the image contosoreg.azurecr.io/reports:prod in Azure Container Instances (ACI) as a scheduled task. The security team forbids saving the registry username or password in deployment templates or scripts. Which approach allows ACI to pull the image while meeting the security requirement?

  • Move the image to a public Docker Hub repository and reference that URL in the deployment.

  • Assign a user-assigned managed identity to the container group and grant it the AcrPull role on contosoreg.

  • Configure contosoreg to allow anonymous pull access.

  • Enable the admin user on contosoreg and supply the registry credentials during container creation.

Question 14 of 20

You are building an Azure Function that runs on a timer trigger and produces a weekly CSV list of every guest user in the Microsoft Entra tenant. The function executes without any interactive user or front-end and must access Microsoft Graph with the least possible privileges to read the entire user collection. How should you configure authentication and authorization for the function?

  • Grant the delegated permission User.ReadWrite.All and have the function acquire tokens through the on-behalf-of flow when it starts.

  • Grant the application permission Directory.Read.All and acquire tokens by using the authorization code flow during the function's startup.

  • Register an app for the function, grant it the application permission User.Read.All, administer tenant consent, and acquire tokens with the client-credentials flow.

  • Grant the delegated permission User.Read to the app and retrieve tokens by using the authorization code flow with an Azure managed identity.

Question 15 of 20

You have an Azure Container Registry named contosoacrrg. The source code for a containerized .NET application resides in the public GitHub repository https://github.com/contoso/api. You need to build the container image in Azure and push it to the registry with tags v1 and latest, all in a single Azure CLI command from your local machine. Which command should you run?

Question 16 of 20

You are preparing to deploy a new web application to Azure App Service. The application will run a Linux-based container image and must reside in the East US2 region using the Basic (B1) pricing tier. Before creating the Web App in the Azure portal, which Azure resource must you provision to satisfy these requirements?

  • An Azure Container Registry in the East US2 region using the Basic SKU

  • An Azure Kubernetes Service (AKS) cluster with a Linux node pool in East US2

  • An App Service plan configured for Linux in the East US2 region on the Basic (B1) tier

  • A virtual network that contains a subnet delegated to an App Service Environment v3

Question 17 of 20

You enable Application Insights using the default ASP.NET Core SDK for an API that calls both a SQL database and an external REST endpoint. You must determine how long each external call takes in order to identify slow dependencies. Which built-in Application Insights telemetry type should you query for this information?

  • Page view telemetry

  • Request telemetry

  • Performance counter telemetry

  • Dependency telemetry

Question 18 of 20

Your Linux container image is stored in Azure Container Registry. The microservice must scale automatically from zero to 50 instances based on Azure Service Bus queue length, provide optional HTTPS ingress with managed TLS, and avoid managing Kubernetes or VMs. Which Azure service best meets these requirements?

  • Azure Kubernetes Service with the KEDA add-on

  • Azure App Service Web App for Containers

  • Azure Container Apps

  • Azure Container Instances

Question 19 of 20

Your build script runs in Azure Cloud Shell and must build a Docker image from the current directory and publish it to an existing Azure Container Registry named contosoacr. The solution must not require the Cloud Shell environment to have the Docker engine installed. Which Azure CLI command should you run?

  • az acr build --registry contosoacr --image web:v1 .

  • az acr import --name contosoacr --source . --image web:v1

  • docker build -t contosoacr.azurecr.io/web:v1 . && docker push contosoacr.azurecr.io/web:v1

  • az container create --registry-login-server contosoacr.azurecr.io --image web:v1 --file Dockerfile

Question 20 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?

  • Custom TrackAvailability test

  • Standard test

  • Multi-step web test

  • URL ping test