Free AZ-204 Sample Questions — Developing Solutions for Microsoft Azure

Free AZ-204 sample questions for the Developing Solutions for Microsoft Azure exam. No account required: study at your own pace.

Want an interactive quiz? Take the full AZ-204 practice test

Looking for more? Click here to get the full PDF with 162+ practice questions for $10 for offline study and deeper preparation.

Question 1

You have an on-premises, public-facing website named www.contoso.com. You plan to test availability of www.contoso.com by using Application Insights availability tests. You need to configure a test that will generate HTTP POST requests that include custom headers. Your solution must minimize development effort. Which type of test should you configure?

  • A. Multi-step web test
  • B. Standard test
  • C. URL ping test
  • D. Custom TrackAvailability test
Show Answer
Correct Answer:
B. Standard test
Question 2

You develop and deploy an Azure Logic app that calls an Azure Function app. The Azure Function app includes an OpenAPI (Swagger) definition and uses an Azure Blob storage account. All resources are secured by using Azure Active Directory (Azure AD). The Azure Logic app must securely access the Azure Blob storage account. Azure AD resources must remain if the Azure Logic app is deleted. You need to secure the Azure Logic app. What should you do?

  • A. Create a user-assigned managed identity and assign role-based access controls
  • B. Create an Azure AD custom role and assign the role to the Azure Blob storage account
  • C. Create an Azure Key Vault and issue a client certificate
  • D. Create a system-assigned managed identity and issue a client certificate
  • E. Create an Azure AD custom role and assign role-based access controls
Show Answer
Correct Answer:
A. Create a user-assigned managed identity and assign role-based access controls
Question 3

You have an Azure Queue Storage named queue1. You plan to develop code that will process messages in queue1. You need to implement a queue operation to set the visibility timeout value of individual messages in queue1. Which two operations can you use? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point.

  • A. Peek at a message in the queue
  • B. Delete a message in the queue
  • C. Add a message to the queue
  • D. Update a message in the queue
  • E. Receive a message from the queue
Show Answer
Correct Answer:
  • D. Update a message in the queue
  • E. Receive a message from the queue
Question 4

You manage an Azure App Service Web App named App1 and an associated Azure Application Insights resource named AppInsights1. You require alerts about any unusual rate increase of failed HTTP requests targeting App1. You need to implement push notifications. What should you do?

  • A. Deploy an Azure Resource Manager template that configures AppInsights1
  • B. From the Azure portal, modify an action group of Azure Monitor
  • C. From the Azure portal, modify diagnostic settings of AppInsights1
  • D. Deploy an Azure Resource Manager template that configures the analyticsItems child resource of AppInsights1
Show Answer
Correct Answer:
B. From the Azure portal, modify an action group of Azure Monitor
Question 5

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. Create a customer-managed key (CMK) and store the key in a new Azure Key Vault instance
Question 6

You are developing several microservices to run on Azure Container Apps for a company. External TCP ingress traffic from the internet has been enabled for the microservices. The company requires that the microservices must scale based on an Azure Event Hub trigger. You need to scale the microservices by using a custom scaling rule. Which two Kubernetes Event-driven Autoscaling (KEDA) trigger fields should you use? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.

  • A. metadata
  • B. type
  • C. authenticationRef
  • D. name
  • E. metricType
Show Answer
Correct Answer:
  • A. metadata
  • B. type
Question 7

You need to implement a solution to resolve the retail store location data issue. Which three Azure Blob features should you enable? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.

  • A. Soft delete
  • B. Change feed
  • C. Snapshots
  • D. Versioning
  • E. Object replication
  • F. Immutability
Show Answer
Correct Answer:
  • A. Soft delete
  • B. Change feed
  • D. Versioning
Question 8

You are developing an online game that includes a feature that allows players to interact with other players on the same team within a certain distance. The calculation to determine the players in range occurs when players move and are cached in an Azure Cache for Redis instance. The system should prioritize players based on how recently they have moved and should not prioritize players who have logged out of the game. You need to select an eviction policy. Which eviction policy should you use?

  • A. allkeys-Iru
  • B. volatile-Iru
  • C. allkeys-lfu
  • D. volatile-ttl
Show Answer
Correct Answer:
B. volatile-Iru
Question 9

You need to ensure that the solution can meet the scaling requirements for Policy Service. Which Azure Application Insights data model should you use?

  • A. an Application Insights dependency
  • B. an Application Insights event
  • C. an Application Insights trace
  • D. an Application Insights metric
Show Answer
Correct Answer:
D. an Application Insights metric
Question 10

You are developing a web application that runs as an Azure Web App. The web application stores data in Azure SQL Database and stores files in an Azure Storage account. The web application makes HTTP requests to external services as part of normal operations. The web application is instrumented with Application Insights. The external services are OpenTelemetry compliant. You need to ensure that the customer ID of the signed in user is associated with all operations throughout the overall system. What should you do?

  • A. Add the customer ID for the signed in user to the CorrelationContext in the web application
  • B. On the current SpanContext, set the TraceId to the customer ID for the signed in user
  • C. Set the header Ocp-Apim-Trace to the customer ID for the signed in user
  • D. Create a new SpanContext with the TraceFlags value set to the customer ID for the signed in user
Show Answer
Correct Answer:
A. Add the customer ID for the signed in user to the CorrelationContext in the web application
Question 11

Your company has an Azure Kubernetes Service (AKS) cluster that you manage from an Azure AD-joined device. The cluster is located in a resource group. Developers have created an application named MyApp. MyApp was packaged into a container image. You need to deploy the YAML manifest file for the application. Solution: You install the Azure CLI on the device and run the kubectl apply `"f myapp.yaml command. Does this meet the goal?

  • A. Yes
  • B. No
Show Answer
Correct Answer:
A. Yes
Question 12

You are building a B2B web application that uses Azure B2B collaboration for authentication. Paying customers authenticate to Azure B2B using federation. The application allows users to sign up for trial accounts using any email address. When a user converts to a paying customer, the data associated with the trial should be kept, but the user must authenticate using federation. You need to update the user in Azure Active Directory (Azure AD) when they convert to a paying customer. Which Graph API parameter is used to change authentication from one-time passcodes to federation?

  • A. resetRedemption
  • B. Status
  • C. userFlowType
  • D. invitedUser
Show Answer
Correct Answer:
A. resetRedemption
Question 13

You are developing an ASP.NET Core Web API web service. The web service uses Azure Application Insights for all telemetry and dependency tracking. The web service reads and writes data to a database other than Microsoft SQL Server. You need to ensure that dependency tracking works for calls to the third-party database. Which two dependency telemetry properties should you use? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.

  • A. Telemetry.Context.Cloud.RoleInstance
  • B. Telemetry.Id
  • C. Telemetry.Name
  • D. Telemetry.Context.Operation.Id
  • E. Telemetry.Context.Session.Id
Show Answer
Correct Answer:
  • B. Telemetry.Id
  • D. Telemetry.Context.Operation.Id
Question 14

You need to reduce read latency for the retail store solution. What are two possible ways to achieve the goal? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point.

  • A. Create a new composite index for the store location data queries in Azure Cosmos DB. Modify the queries to support parameterized SQL and update the Azure Function app to call the new queries
  • B. Provision an Azure Cosmos DB dedicated gateway. Update the Azure Function app connection string to use the new dedicated gateway endpoint
  • C. Configure Azure Cosmos DB consistency to session consistency. Cache session tokens in a new Azure Redis cache instance after every write. Update reads to use the session token stored in Azure Redis
  • D. Provision an Azure Cosmos DB dedicated gateway. Update blob storage to use the new dedicated gateway endpoint
  • E. Configure Azure Cosmos DB consistency to strong consistency. Increase the RUs for the container supporting store location data
Show Answer
Correct Answer:
  • A. Create a new composite index for the store location data queries in Azure Cosmos DB. Modify the queries to support parameterized SQL and update the Azure Function app to call the new queries
  • B. Provision an Azure Cosmos DB dedicated gateway. Update the Azure Function app connection string to use the new dedicated gateway endpoint
Question 15

You need to resolve the log capacity issue. What should you do?

  • A. Create an Application Insights Telemetry Filter
  • B. Change the minimum log level in the host.json file for the function
  • C. Implement Application Insights Sampling
  • D. Set a LogCategoryFilter during startup
Show Answer
Correct Answer:
B. Change the minimum log level in the host.json file for the function
Question 16

You need to ensure that all messages from Azure Event Grid are processed. What should you use?

  • A. Azure Event Grid topic
  • B. Azure Service Bus topic
  • C. Azure Service Bus queue
  • D. Azure Storage queue
  • E. Azure Logic App custom connector
Show Answer
Correct Answer:
C. Azure Service Bus queue
Question 17

A company maintains multiple web and mobile applications. Each application uses custom in-house identity providers as well as social identity providers. You need to implement single sign-on (SSO) for all the applications. What should you do?

  • A. Use Azure Active Directory B2C (Azure AD B2C) with custom policies
  • B. Use Azure Active Directory B2B (Azure AD B2B) and enable external collaboration
  • C. Use Azure Active Directory B2C (Azure AD B2C) with user flows
  • D. Use Azure Active Directory B2B (Azure AD B2B)
Show Answer
Correct Answer:
A. Use Azure Active Directory B2C (Azure AD B2C) with custom policies
Question 18

You develop and deploy an Azure App Service web app named App1. You create a new Azure Key Vault named Vault1. You import several API keys, passwords, certificates, and cryptographic keys into Vault1. You need to grant App1 access to Vault1 and automatically rotate credentials. Credentials must not be stored in code. What should you do?

  • A. Enable App Service authentication for Appl. Assign a custom RBAC role to Vault1
  • B. Add a TLS/SSL binding to App1
  • C. Upload a self-signed client certificate to Vault1. Update App1 to use the client certificate
  • D. Assign a managed identity to App1
Show Answer
Correct Answer:
D. Assign a managed identity to App1
Question 19

You are developing an Azure Durable Function to manage an online ordering process. The process must call an external API to gather product discount information. You need to implement the Azure Durable Function. Which Azure Durable Function types should you use? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.

  • A. Orchestrator
  • B. Entity
  • C. Client
  • D. Activity
Show Answer
Correct Answer:
  • A. Orchestrator
  • D. Activity
Question 20

A company is implementing a publish-subscribe (Pub/Sub) messaging component by using Azure Service Bus. You are developing the first subscription application. In the Azure portal you see that messages are being sent to the subscription for each topic. You create and initialize a subscription client object by supplying the correct details, but the subscription application is still not consuming the messages. You need to ensure that the subscription client processes all messages. Which code segment should you use?

  • A. await subscriptionClient.AddRuleAsync(new RuleDescription(RuleDescription.DefaultRuleName, new TrueFilter()));
  • B. subscriptionClient = new SubscriptionClient(ServiceBusConnectionString, TopicName, SubscriptionName);
  • C. await subscriptionClient.CloseAsync();
  • D. subscriptionClient.RegisterMessageHandler(ProcessMessagesAsync, messageHandlerOptions);
Show Answer
Correct Answer:
D. subscriptionClient.RegisterMessageHandler(ProcessMessagesAsync, messageHandlerOptions);

Aced these? Get the Full Exam

Download the complete AZ-204 study bundle with 162+ questions in a single printable PDF.