Exam AZ-204: Developing Solutions for Microsoft Azure — Questions and Answers
Question 1: What is the purpose of the `local.settings.json` file in Azure Functions development?
- Stores connection strings and app settings for local development only (Correct answer)
- Configures binding extensions
- Defines production environment variables
- Sets the runtime version for deployment
Correct answer: Stores connection strings and app settings for local development only
`local.settings.json` holds app settings and connection strings used only during local development and should never be committed to source control.
Question 2: Which Azure Cosmos DB consistency level guarantees that within a single client session, reads always reflect that client's own writes?
- Eventual
- Consistent Prefix
- Bounded Staleness
- Session (Correct answer)
Correct answer: Session
Session consistency is scoped to a client session and guarantees monotonic reads, monotonic writes, and read-your-writes within that session.
Question 3: Your business has a Recovery Services vault as part of their Azure subscription. <br> <br> The virtual machines (VMs) your business uses should be backed up to the Recovery Services vault using Azure Backup. <br> <br> Which of the following VMs can you back up? Choose all that apply.
- VMs that run Windows Server 2012 or higher. (Correct answer)
- VMs that run Debian 8.2+. (Correct answer)
- VMs that have NOT been shut down. (Correct answer)
- VMs that have been shut down. (Correct answer)
- VMs that run Windows 10. (Correct answer)
Correct answer: VMs that run Windows Server 2012 or higher.
Windows Server 2008's 64-bit operating system may be backed up using Azure Backup <br> Windows 10 64-bit backup is supported by Azure Backup <br> Debian 64-bit operating systems starting with Debian 7.9 and later are supported by Azure Backup <br> Virtual machines that are offline or inactive can be backed up using Azure Backup
Question 4: Which configuration setting in an Azure Web App controls which version of the .NET runtime is used?
- FUNCTIONS_WORKER_RUNTIME
- DOTNET_VERSION (Correct answer)
- WEBSITE_DOTNET_FRAMEWORK
- ASPNETCORE_ENVIRONMENT
Correct answer: DOTNET_VERSION
The `DOTNET_VERSION` app setting (or the stack settings in the portal) tells the App Service runtime which .NET version to use.
Question 5: What is the default maximum execution timeout for an Azure Function running on the Consumption plan?
- 10 minutes (Correct answer)
- 30 minutes
- 1 minute
- 5 minutes
Correct answer: 10 minutes
On the Consumption plan, Azure Functions default to a 5-minute timeout but the maximum allowed is 10 minutes.
Question 6: You have VM1, a virtual computer in Azure. The identical parameters as VM1 must be used to generate five more virtual machines. The answer must guarantee that VM1 is always accessible. You open the blade for VM1 from the Azure portal. What ought you to do now?
- Select Redeploy + reapply
- Select Availability and scaling
- Select Export template (Correct answer)
- Select Capture
Correct answer: Select Export template
To create five additional virtual machines with the same configurations as VM1 while ensuring VM1 remains available, you should select "Export template" from the Azure portal blade for VM1.
Question 7: Which MSAL (Microsoft Authentication Library) method acquires a token silently from the cache before falling back to interactive login?
- AcquireTokenSilent (Correct answer)
- AcquireTokenOnBehalfOf
- AcquireTokenByUsernamePassword
- AcquireTokenInteractive
Correct answer: AcquireTokenSilent
`AcquireTokenSilent` returns a cached or refreshed access token without user interaction, only prompting when silent acquisition fails.
Question 8: What Azure service enables developers to use the `DefaultAzureCredential` class that automatically picks the best available credential?
- Azure Key Vault SDK only
- Azure Identity SDK (`Azure.Identity`) (Correct answer)
- Microsoft.Azure.Services.AppAuthentication
- MSAL.NET only
Correct answer: Azure Identity SDK (`Azure.Identity`)
`DefaultAzureCredential` is part of the `Azure.Identity` library and tries a chain of credential sources (managed identity, env vars, CLI, etc.) in order.
Question 9: Which deployment method in Azure App Service supports 'infrastructure as code' by describing app configuration in an ARM template?
- ARM template deployment (Correct answer)
- ZIP deploy
- GitHub Actions
- FTP deployment
Correct answer: ARM template deployment
ARM template deployment describes both the App Service resource and its configuration declaratively as infrastructure as code.
Question 10: In `host.json`, which setting controls the maximum number of concurrent function executions per instance?
- maxOutstandingRequests
- maxConcurrentCalls (Correct answer)
- functionTimeout
- maxConcurrentInstances
Correct answer: maxConcurrentCalls
`maxConcurrentCalls` in `host.json` under the `queues` or `serviceBus` extension limits how many function invocations run in parallel per host.
Question 11: Several Azure runbooks are included with your Azure subscription. The runbooks provide reports each night while they run. Authentication credentials are kept in the runbooks as variables. You must swap out the current authentication method with a more secure one. What ought you use?
- An administrative unit
- An access policy
- Azure Key Vault (Correct answer)
- Azure Active Directory (Azure AD) Identity Protection
Correct answer: Azure Key Vault
To replace the authentication solution for storing credentials in Azure runbooks with a more secure option, you should use Azure Key Vault.
Question 12: On a tier D1 app service subscription, you create a web application. You observe that during instances of high traffic, page load times rise. When CPU load is greater than 80%, automatic scaling should be used. Your recommendation must reduce expenses. What ought to you start with?
- Switch to the Azure App Services consumption plan.
- Switch to the Standard App Service tier plan. (Correct answer)
- Switch to the Premium App Service tier plan.
- Enable autoscaling on the Web App.
Correct answer: Switch to the Standard App Service tier plan.
The D1 (Shared) App Service tier is a basic plan that does not support autoscaling, which is a key requirement for handling high traffic. To enable autoscaling based on CPU load and improve performance, the application needs to be moved to a higher tier that offers this functionality. The Standard App Service tier is the lowest-cost option that provides autoscaling capabilities, making it the most economical initial step to meet the specified requirements.
Question 13: You have a tenant called contoso.com in Azure Active Directory (Azure AD). It would help if you ensured that User1 has access to the tenant's set of settings. It must be impossible for User1 to alter any settings. Which role ought should you provide User1?
- Directory reader
- Security reader
- Reports reader
- Global reader (Correct answer)
Correct answer: Global reader
To ensure that User1 can review all the settings of the Azure Active Directory (Azure AD) tenant but is prevented from changing any settings, you should assign the "Global reader" role to User1.
Question 14: Which file defines the bindings and trigger configuration for an Azure Function in the non-isolated worker model?
- host.json
- bindings.json
- function.json (Correct answer)
- local.settings.json
Correct answer: function.json
`function.json` contains the trigger, input binding, and output binding definitions for each Azure Function.
Question 15: In Azure Service Bus, what feature ensures that only one consumer processes a related group of messages in order?
- Message sessions (Correct answer)
- Dead-letter queue
- Topic subscriptions
- Message lock
Correct answer: Message sessions
Message sessions (enabled per queue/subscription) group related messages by session ID and guarantee ordered, exclusive processing by one consumer at a time.
Question 16: What is the default Time-to-Live (TTL) for messages in an Azure Service Bus queue?
- 1 hour
- It is set to TimeSpan.MaxValue (no expiry by default) (Correct answer)
- 1 day
- 14 days
Correct answer: It is set to TimeSpan.MaxValue (no expiry by default)
By default, Service Bus messages have a TTL of `TimeSpan.MaxValue`, meaning they do not expire unless a custom TTL is set on the queue or message.
Question 17: What is the purpose of the `extensions.csproj` file generated by `func extensions install`?
- Defines the Functions runtime version
- Manages NuGet packages for binding extensions in the non-.NET isolated model (Correct answer)
- Stores function trigger metadata
- Configures the deployment pipeline
Correct answer: Manages NuGet packages for binding extensions in the non-.NET isolated model
`extensions.csproj` lists the NuGet binding extension packages so the Functions host can load triggers like Service Bus or Event Grid.
Question 18: What is the maximum size of a single document (item) in Azure Cosmos DB?
- 4 MB (Correct answer)
- 16 MB
- 1 MB
- 2 MB
Correct answer: 4 MB
Azure Cosmos DB supports individual item (document) sizes up to 2 MB.
Question 19: In an Azure Function, what interface should the injected logger implement for structured logging?
- TraceWriter
- ILogger (Correct answer)
- EventLog
- DiagnosticSource
Correct answer: ILogger
Azure Functions supports `ILogger` (from Microsoft.Extensions.Logging) for structured, leveled log output that integrates with Application Insights.
Question 20: Which consistency level in Azure Cosmos DB provides the strongest consistency guarantee?
- Eventual
- Session
- Strong (Correct answer)
- Bounded Staleness
Correct answer: Strong
Strong consistency ensures linearizability, meaning reads always return the most recent committed version of an item.
Question 21: What attribute marks a C# Azure Function as triggered by an HTTP request?
- [WebHook]
- [RestTrigger]
- [HttpTrigger] (Correct answer)
- [FunctionTrigger("http")]
Correct answer: [HttpTrigger]
The `[HttpTrigger]` attribute on a function parameter configures the Azure Function to execute on incoming HTTP requests.
Question 22: Which Azure Key Vault soft-delete feature protects against accidental deletion by retaining deleted vaults for a configurable period?
- Soft delete (Correct answer)
- Backup and restore
- Access policy deny
- Purge protection
Correct answer: Soft delete
Soft delete retains deleted Key Vault resources for a retention period (default 90 days) during which they can be recovered.
Question 23: Your company's Azure solution uses multi-factor authentication when users are not in the office. The use model has been set to the Per Authentication option. <br> You are notified that these workers should also utilize Multi-Factor Authentication after purchasing a smaller firm and enrolling the new workforce in Azure Active Directory (Azure AD). <br> To achieve this, the Per Enabled User setting must be set for the usage model. <br> Solution: You make a backup of the data from the current Multi-Factor Authentication provider and use it to construct a new Multi-Factor Authentication provider. <br> Does the solution meet the goal?
- Yes
- No (Correct answer)
Correct answer: No
You cannot change the usage model (for example from Per Authentication to Per Enabled User) on an existing MFA provider, and simply backing up data to build a new provider does not, by itself, transition the new workforce onto the required model — the answer is No because the described action doesn't accomplish the stated billing/enforcement change. The correct approach is to create a new provider configured with the desired usage model and link it to the directory.
Question 24: In Azure Container Registry, which command authenticates the Docker CLI to a private registry?
- docker login azure
- az login --container
- az acr login --name <registry> (Correct answer)
- az acr authenticate
Correct answer: az acr login --name <registry>
`az acr login --name <registry>` uses Azure CLI credentials to authenticate Docker with the specified ACR instance.
Question 25: You work for your company as a developer. For an existing Logic App, the definitions need to be updated. Which should you employ?
- the Logic App Code View (Correct answer)
- the API Connections
- the Enterprise Integration Pack (EIP)
- the Logic Apps Designer
Correct answer: the Logic App Code View
While the Logic Apps Designer provides a visual interface for building and modifying workflows, the Logic App Code View offers direct access to the underlying JSON definition of the Logic App. This view is essential for making precise, bulk, or advanced updates to the workflow's structure, actions, and triggers that might be difficult or impossible through the graphical designer alone. It provides granular control over the Logic App's definition.
Question 26: What is a managed identity in Azure, and what problem does it solve?
- A service principal with a client certificate
- An identity for VM guest OS logins only
- A role assignment for resource groups
- A user account managed by Azure AD for service-to-service auth, eliminating stored credentials (Correct answer)
Correct answer: A user account managed by Azure AD for service-to-service auth, eliminating stored credentials
Managed identities are Azure AD identities automatically managed by Azure for services, removing the need to store and rotate credentials in code.
Question 27: Azure Active Directory (Azure AD) is a service that your business subscribes to. <br> <br> You wish to establish a conditional access policy for Azure AD. <br> <br> When connecting to Azure AD from untrusted places, members of the Global Administrators group must utilize Multi-Factor Authentication and a device that is connected to Azure AD. <br> <br> Solution: You access the Azure portal to alter the grant control of the Azure AD conditional access policy. <br> <br> Does the solution meet the goal?
- No
- Yes (Correct answer)
Correct answer: Yes
Requirements like enforcing Multi-Factor Authentication and requiring an Azure AD–joined/compliant device are configured under the GRANT controls of a Conditional Access policy. Since the solution modifies the grant control, it meets the goal, so the answer is Yes.
Question 28: You work for your company as a developer. The workflows for an existing Logic App need to be changed. Which should you employ?
- the Logic Apps Designer
- the Enterprise Integration Pack (EIP) (Correct answer)
- the Logic App Code View
- the API Connections
Correct answer: the Enterprise Integration Pack (EIP)
The Enterprise Integration Pack (EIP) in Azure Logic Apps provides a suite of connectors and capabilities specifically designed for complex B2B and enterprise integration scenarios. If the changes to an existing Logic App workflow involve integrating with enterprise systems, handling EDI, AS2, X12, or XML messages, or performing advanced data transformations, then the components and features provided by the EIP would be employed to implement these specific workflow modifications.
Question 29: What Durable Functions feature enables long-running workflows to pause and wait for an external event?
- createTimer
- waitForExternalEvent (Correct answer)
- callActivityAsync
- continueAsNew
Correct answer: waitForExternalEvent
`waitForExternalEvent` suspends an orchestration and resumes it when a named external event is raised via the client API.
Question 30: In Azure Event Hubs, what is a 'consumer group'?
- A group of publishers sharing an access key
- A set of partitions assigned to a single reader
- A batch of events processed together
- A logical view of an Event Hub that enables multiple independent readers to read the same stream (Correct answer)
Correct answer: A logical view of an Event Hub that enables multiple independent readers to read the same stream
Consumer groups allow multiple downstream applications to read the full event stream independently at their own pace without interfering with each other.
Question 31: In Azure Durable Functions, which function type orchestrates the execution of other functions?
- Orchestrator function (Correct answer)
- Client function
- Entity function
- Activity function
Correct answer: Orchestrator function
Orchestrator functions define the workflow logic and coordinate calls to activity functions using async/await patterns.
Question 32: Which environment variable automatically provided by App Service exposes the deployment slot name at runtime?
- APP_SLOT
- DEPLOYMENT_SLOT
- AZURE_SLOT_NAME
- WEBSITE_SLOT_NAME (Correct answer)
Correct answer: WEBSITE_SLOT_NAME
`WEBSITE_SLOT_NAME` is automatically set by App Service to the name of the current deployment slot (e.g., `staging` or `production`).
Question 33: When using Azure Container Apps, what component manages traffic splitting between revisions for A/B testing?
- Ingress traffic weights (Correct answer)
- Application Gateway routing
- Load balancer rules
- Deployment slots
Correct answer: Ingress traffic weights
Azure Container Apps ingress traffic weights allow you to split a percentage of traffic between named revisions for gradual rollouts.
Question 34: Which partition key choice would result in the BEST throughput distribution in a Cosmos DB container storing IoT sensor readings?
- deviceId (Correct answer)
- deviceRegion
- readingDate
- sensorType
Correct answer: deviceId
Using deviceId distributes data evenly across logical partitions since each device generates a unique stream of readings, avoiding hot partitions.
Question 35: Which setting in `host.json` configures the Application Insights instrumentation key for a Functions app?
- APPLICATIONINSIGHTS_CONNECTION_STRING app setting (Correct answer)
- logging.applicationInsights.samplingSettings
- host.json insights.key
- APPINSIGHTS_INSTRUMENTATIONKEY in local.settings.json
Correct answer: APPLICATIONINSIGHTS_CONNECTION_STRING app setting
Azure Functions connects to Application Insights via the `APPLICATIONINSIGHTS_CONNECTION_STRING` application setting (preferred over instrumentation key).
Question 36: What OAuth 2.0 flow should a confidential server-side web app use to authenticate users via Azure AD?
- Implicit flow
- Device code flow
- Authorization code flow (Correct answer)
- Client credentials flow
Correct answer: Authorization code flow
The authorization code flow is the recommended OAuth flow for server-side apps, exchanging a code for tokens securely on the back channel.
Question 37: The Azure Web Application Firewall (WAF) is guarding the web application you are creating. An Azure Application is used to route all traffic to the web application. several web apps that use the same gateway instance. Contoso.azurewebsites.net is the URL for the web application. SSL must be used to secure all traffic. Several web apps use the Azure Application Gateway instance. For the web app, the Azure Application Gateway needs to be configured. What are the two things you should do? Each right response offers a piece of the answer. NOTE: There are two (2) answers in this question.
- Convert the web app to run in an Azure App service environment (ASE).
- In the Azure Application Gatewayג€™s HTTP setting, enable the Use for App service setting. (Correct answer)
- Add an authentication certificate for contoso.azurewebsites.net to the Azure Application Gateway.
- In the Azure Application Gatewayג€™s HTTP setting, set the value of the Override backend path option to contoso22.azurewebsites.net. (Correct answer)
Correct answer: In the Azure Application Gatewayג€™s HTTP setting, enable the Use for App service setting.
To configure Azure Application Gateway for an Azure Web App with SSL: (B) Enabling the 'Use for App service' setting in the HTTP settings automatically configures the backend target to use the App Service's default host header, ensuring correct and secure routing. (A) The 'Override backend path' option is typically used for URL path rewriting. However, if interpreted as overriding the *host header* to a specific backend hostname (e.g., `contoso22.azurewebsites.net` if that's the actual internal App Service target), it could be necessary for specific routing scenarios, despite the option's literal wording referring to a 'path' and a potentially different hostname than the stated web app URL.
Question 38: Which Azure event service is best suited for high-throughput telemetry ingestion from IoT devices?
- Azure Event Hubs (Correct answer)
- Azure Notification Hubs
- Azure Event Grid
- Azure Service Bus
Correct answer: Azure Event Hubs
Azure Event Hubs is designed for high-throughput streaming of millions of events per second, making it ideal for telemetry and log ingestion.
Question 39: What is the unit used to measure provisioned throughput in Azure Cosmos DB?
- IOPS (Input/Output Operations per Second)
- DTU (Database Transaction Units)
- vCores per second
- RU/s (Request Units per second) (Correct answer)
Correct answer: RU/s (Request Units per second)
Azure Cosmos DB uses Request Units per second (RU/s) as the abstracted currency for CPU, IOPS, and memory consumed by operations.
Question 40: Which claim in a JWT access token issued by Azure AD uniquely identifies the user across all Azure AD tenants?
- upn (user principal name)
- sub (subject)
- oid (object ID) (Correct answer)
- tid (tenant ID)
Correct answer: oid (object ID)
The `oid` claim is the immutable object ID of the user in Azure AD and is stable across tenant changes, unlike `sub` which is app-specific.
Exam AZ-204: Developing Solutions for Microsoft Azure
This exam certifies candidates' expertise in designing, building, testing, and maintaining cloud applications and services on Microsoft Azure.
Exam Rules
- You can skip questions and return to them later
- Flag questions for review before submitting
- No feedback shown until you submit the entire exam
- Unanswered questions count as wrong — answer everything
- 10 pretest questions are mixed in and don't affect your score
- Timer auto-submits when time runs out
- Your progress is auto-saved every 30 seconds
Practice questions written with AI assistance and published by Nathan Beja, founder of Practice Test Geeks. They are not real exam questions. Exam facts are checked against the official sources linked below. Editorial policy
Sources & references
Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy
- learn.microsoft.com — Renewal, exam information · verified Oct 2026
- techcommunity.microsoft.com — Retake policy, score validity, exam information · verified Oct 2026