AZ-204 Developing Azure Solutions - Practice Test 3
Your Progress
0 / 50
Question 1MEDIUM
You are developing an application using Azure Container Apps. You need to configure the application to scale from zero instances when idle and scale to 10 instances based on HTTP concurrent requests.
Which scaling rule should you configure?
Azure Container Apps supports HTTP scaling rules that scale based on the number of concurrent HTTP requests. Set minReplicas to 0 for scale-to-zero and maxReplicas to 10. KEDA cron (A) is time-based. Azure Monitor autoscale (C) is for App Service. Manual scaling (D) does not auto-scale.
See more: Containers
Question 2MEDIUM
You are configuring Azure Cosmos DB with the SQL API. You need to implement optimistic concurrency control when updating documents.
Which HTTP header should you use?
The If-Match header with the document's ETag value implements optimistic concurrency. If the document has been modified since the ETag was retrieved, the update fails with a 412 Precondition Failed. x-ms-consistency-level (A) sets consistency. x-ms-documentdb-partitionkey (B) specifies the partition. x-ms-session-token (C) is for session consistency.
See more: CosmosDB
Question 3EASY
You are developing an Azure Function that must process messages from an Azure Storage Queue. Which binding configuration is correct?
The QueueTrigger attribute connects an Azure Function to an Azure Storage Queue. It requires the queue name and a reference to the connection setting in app settings. BlobTrigger (B) is for blob storage. EventHubTrigger (C) is for Event Hub. ServiceBusTrigger (D) is for Service Bus queues, not Storage queues.
See more: Function App
Question 4MEDIUM
You need to implement Azure Blob Storage lifecycle management. Blobs should be moved to Cool tier after 30 days and to Archive tier after 90 days.
Where do you define this policy?
Lifecycle management rules are defined in JSON format at the storage account level. They define conditions (days since creation/modification) and actions (move to cool/archive/delete). Container access policies (A) manage SAS. Azure Policy (B) enforces compliance, not storage tiering. Automation runbooks (D) require custom scripting.
See more: Azure Storage Accounts
Question 5HARD
You are implementing MSAL (Microsoft Authentication Library) in a single-page application. You need to acquire tokens silently after the initial login.
Which method should you call first before falling back to an interactive method?
The recommended MSAL pattern is to first call acquireTokenSilent(), which attempts to get a token from the cache or refresh it. If this fails (InteractionRequiredAuthError), fall back to an interactive method like acquireTokenPopup() or acquireTokenRedirect(). loginPopup (A) initiates a new login. acquireTokenRedirect (C) redirects the user. getTokenByCode (D) is server-side.
See more: Azure Authentication
Question 6MEDIUM
You are using Azure Key Vault and need to reference a specific version of a secret in your application configuration.
What is the correct URI format?
The correct Key Vault secret URI format includes the vault name, followed by /secrets/{secret-name}/{version}. The version is part of the path, not a query parameter (B). The path structure in C is incorrect. The domain is vault.azure.net, not keyvault.azure.net (D).
See more: Data Encryption
Question 7MEDIUM
You are configuring Application Insights sampling to reduce telemetry volume. You want to maintain accurate request counts while reducing the data.
Which sampling type should you use?
Adaptive sampling automatically adjusts the sampling rate based on telemetry volume while preserving related items together and maintaining statistical accuracy. Fixed-rate (A) uses a constant percentage. Ingestion sampling (B) discards data at the server side. No sampling (C) does not reduce volume.
See more: Application Insights
Question 8MEDIUM
You are developing an application that uses Azure Service Bus topics. You need to create a subscription filter that routes messages based on a custom property called "region" with the value "us-east".
What type of filter should you use?
A SQL filter allows you to define conditions based on custom message properties using SQL-like syntax. "region = 'us-east'" routes only messages with that property value. Boolean filter (A) accepts all or no messages. Correlation filter on MessageId (B) matches system properties. Without filters (D), all messages go to all subscriptions by default (true filter).
See more: Application Messaging
Question 9EASY
You want to deploy a containerized application to Azure without managing VMs or orchestrators. The application handles HTTP requests and should scale automatically.
Which service should you use?
Azure Container Apps provides a serverless container hosting platform with automatic scaling, built-in HTTP ingress, and no infrastructure management. VMs (A) require management. AKS (C) requires cluster management. Azure Batch (D) is for large-scale parallel computing jobs.
See more: Containers
Question 10HARD
You are configuring Cosmos DB with multiple consistency levels. Your application reads data immediately after writing it and requires the read to return the latest write.
Which is the lowest (most relaxed) consistency level that guarantees this within a single session?
Session consistency guarantees read-your-own-writes within a single client session. It is the most commonly used and default consistency level. Strong (B) provides linearizability across all regions but is more costly. Bounded Staleness (C) and Consistent Prefix (D) do not guarantee immediate read-your-writes.
See more: CosmosDB
Question 11MEDIUM
You are deploying an Azure App Service and need to configure custom domain name with SSL. You want to use a free managed certificate.
Which pricing tier is the minimum required?
Custom domains with SSL require at least the Basic (B1) tier. Free managed certificates are available starting from B1. Free (A) and Shared (B) tiers do not support custom SSL bindings. Standard (D) works but is not the minimum.
See more: Containers
Question 12MEDIUM
You need to implement retry logic for transient failures when calling an external HTTP API from your Azure application.
Which pattern should you implement?
The Retry pattern with exponential backoff and jitter (randomization) is the recommended approach for transient failures. Exponential backoff increases wait time between retries, and jitter prevents thundering herd. Circuit Breaker (A) prevents repeated calls to a failing service but does not retry. Bulkhead (C) isolates failures. Compensating Transaction (D) handles rollbacks.
See more: Consuming Azure Services
Question 13MEDIUM
You are using Azure Event Grid with a webhook endpoint. Event Grid sends a validation request when you create an event subscription.
How should your webhook respond to validate the subscription?
When Event Grid sends a SubscriptionValidationEvent, the webhook must return HTTP 200 with the validationCode echoed in the response body as validationResponse. An empty body (A) does not complete validation. HTTP 401 (B) rejects the request. A separate POST (C) is the manual validation method for endpoints you do not control.
See more: Event-Based Solutions
Question 14MEDIUM
You need to configure Azure App Service authentication (Easy Auth) for your web application. You want to require all users to authenticate before accessing any page.
What should you set the "Restrict access" option to?
Setting "Require authentication" in Easy Auth blocks all unauthenticated requests and redirects users to the configured identity provider. "Allow unauthenticated" (B) lets requests through without authentication. Options C and D do not enforce authentication on all pages.
See more: Azure Authentication
Question 15EASY
You need to store non-relational data with automatic global distribution and single-digit millisecond latency.
Which Azure service should you use?
Azure Cosmos DB is a globally distributed, multi-model NoSQL database with guaranteed single-digit millisecond latency and automatic multi-region replication. Azure SQL (A) and PostgreSQL (D) are relational. Table Storage (B) does not provide global distribution or SLA-backed latency.
See more: CosmosDB
Question 16MEDIUM
You are implementing Azure Blob Storage immutability policies. You need to ensure blobs cannot be modified or deleted for a compliance retention period.
Which policy type should you configure?
A time-based retention policy ensures blobs cannot be modified or deleted for a specified retention period. Legal hold (A) prevents changes until explicitly cleared (no time bound). Soft delete (C) allows recovery after deletion but does not prevent deletion. Lifecycle management (D) moves or deletes blobs automatically.
See more: Azure Storage Accounts
Question 17MEDIUM
You are developing a Durable Functions fan-out/fan-in orchestration. You need to run 10 activity functions in parallel and wait for all to complete.
Which approach is correct?
The fan-out/fan-in pattern creates multiple Task objects by calling CallActivityAsync without awaiting each one, collects them in a list, and then uses Task.WhenAll to wait for all tasks to complete. Sequential awaiting (B) is not parallel. Sub-orchestrators (C) add overhead. ContinueAsNew (D) restarts the orchestration.
See more: Function App
Question 18MEDIUM
You are configuring an OAuth 2.0 scope for a web API registered in Microsoft Entra ID. The API needs to expose a permission called "read_data" that client apps can request.
Where do you configure this?
The "Expose an API" blade on the API's app registration is where you define scopes (permissions) that client applications can request. API permissions (A) is where clients request permissions. Authentication (B) configures redirect URIs. Token configuration (C) configures optional claims.
See more: Azure Authentication
Question 19MEDIUM
You are implementing distributed tracing across multiple Azure services. You need to correlate requests between an API Management gateway, a backend App Service, and a downstream Azure Function.
Which Application Insights feature enables this?
Application Map with distributed tracing shows the topology of your application and correlates requests across components using operation correlation (W3C trace context). Metrics Explorer (A) shows metric charts. Live Metrics (B) shows real-time telemetry. Workbooks (D) create interactive reports.
See more: Application Insights
Question 20MEDIUM
You are developing a solution with Azure Service Bus. Your application needs to send a batch of related messages that should either all succeed or all fail.
Which feature should you use?
ServiceBusMessageBatch with SendMessagesAsync sends a batch of messages atomically - they all succeed or all fail. Message sessions (A) provide ordered processing by session. Duplicate detection (C) prevents duplicate message processing. Auto-forwarding (D) chains queues.
See more: Application Messaging
Question 21MEDIUM
You are using Azure Container Registry Tasks to automatically build container images when source code changes in a Git repository.
Which task type should you configure?
ACR Tasks supports automatic builds triggered by source code commits (Git commit triggers). Quick tasks run on-demand builds from Git context. Scheduled tasks (B) run on a schedule, not on code changes. az acr build (C) is manual. Timer triggers (D) are time-based.
See more: Containers
Question 22EASY
Which Cosmos DB consistency level provides the strongest guarantee?
Strong consistency provides linearizability - reads are guaranteed to return the most recent committed version. The hierarchy from strongest to weakest is: Strong > Bounded Staleness > Session > Consistent Prefix > Eventual.
See more: CosmosDB
Question 23HARD
You are implementing Azure Storage account failover. The account uses RA-GRS (Read-Access Geo-Redundant Storage). The primary region becomes unavailable.
What happens to read operations during the outage?
With RA-GRS, the secondary endpoint (with -secondary suffix) is always available for reads. During a primary outage, your application must be designed to redirect reads to the secondary endpoint. There is no automatic redirect (B). Azure does not auto-failover (D) - you must initiate it. Read operations to the primary will fail but secondary reads succeed (A is partially wrong).
See more: Azure Storage Accounts
Question 24MEDIUM
You are configuring Azure Function host.json for an Event Hub triggered function. You need to limit the batch size to process a maximum of 50 events at a time.
Which property should you configure?
maxEventBatchSize controls the maximum number of events per batch delivered to the function. prefetchCount (C) controls how many events are prefetched from the Event Hub. The correct property name is maxEventBatchSize (not maxBatchSize in D).
See more: Event-Based Solutions
Question 25MEDIUM
You are implementing Azure Key Vault with managed identity for an Azure App Service. Which step is NOT required?
Storing Key Vault access keys in app settings is NOT required and defeats the purpose of managed identity. The whole point of managed identity is to avoid managing credentials. You enable the identity (B), grant it access (C), and use DefaultAzureCredential in code (D).
See more: Data Encryption
Question 26MEDIUM
You are configuring Azure API Management rate limiting. You want to limit each subscription to 100 calls per minute.
Which policy should you use?
rate-limit-by-key restricts call rate by a specified key (subscription, IP, etc.) within a time window. quota-by-key (A) limits total volume over a longer period. ip-filter (B) restricts access by IP. cors (D) handles cross-origin requests.
See more: Consuming Azure Services
Question 27EASY
You need to execute a one-time containerized workload in Azure without managing infrastructure. The container runs a batch job and exits.
Which service is most cost-effective?
Azure Container Instances with OnFailure restart policy runs the container once and stops (only restarting if it fails). You pay only for the resources consumed during execution. AKS (A) requires cluster management. App Service (C) runs continuously. Container Apps (D) adds overhead for a one-time job.
See more: Containers
Question 28MEDIUM
You are implementing Azure Function triggers. Your function should process each new or modified document in a Cosmos DB container.
Which trigger type provides guaranteed ordering per partition key?
The Cosmos DB trigger uses the change feed processor and provides guaranteed ordering of changes within a partition key. HTTP trigger (A) is request-based. Timer trigger (B) adds complexity. Queue trigger (C) is for message processing.
See more: Function App
Question 29MEDIUM
You need to implement Microsoft Entra ID token caching in a confidential client application running on a web server. Which cache implementation is recommended?
For web servers (especially with multiple instances), a distributed token cache (Redis or SQL) is recommended to share tokens across server instances and survive restarts. In-memory cache (B) is lost on restart and not shared. Browser storage (C) is client-side and insecure for tokens. File-based cache (D) is not shared across instances.
See more: Azure Authentication
Question 30MEDIUM
You are configuring Application Insights alerts. You want to be notified when the average response time exceeds 2 seconds for 5 consecutive minutes.
Which alert type should you create?
A metric alert with static threshold evaluates a metric (response time) against a fixed value (2 seconds) over a time window (5 minutes). Activity log alerts (A) monitor management operations. Smart detection (B) uses ML to detect anomalies. Log search alerts (D) run log queries.
See more: Application Insights
Question 31MEDIUM
You are implementing Azure Service Bus sessions. You need to ensure messages with the same session ID are processed in order by a single consumer.
Which property must be set when creating the queue?
RequiresSession must be set to true when creating the queue to enable session support. This ensures messages with the same SessionId are processed in FIFO order by a single consumer. Partitioning (A) splits the queue across brokers. Dead lettering (C) handles failed messages. MaxDeliveryCount (D) limits retries.
See more: Application Messaging
Question 32MEDIUM
You are developing an application that uses Azure Blob Storage change feed. You need to audit all changes to blobs in a specific container.
What type of events does the change feed capture?
The Azure Blob Storage change feed captures create (BlobCreated), update, and soft-delete (BlobDeleted) events. It provides an ordered, guaranteed, and durable log of changes. It does not capture read events (C) or metadata-only changes (D).
See more: Azure Storage Accounts
Question 33MEDIUM
You are implementing RBAC for a Cosmos DB account. You need to grant a developer read-only access to data in a specific database, without access to management operations.
Which built-in role should you assign?
The Cosmos DB Built-in Data Reader role provides read-only access to data (documents, collections) within Cosmos DB. Account Reader (A) provides read access to account metadata, not data. Contributor (B) provides full management access. Operator (C) manages the account but cannot access data.
See more: CosmosDB
Question 34MEDIUM
You are using Azure Functions with the Consumption plan. Your function has cold start issues that impact user experience.
Which approach reduces cold start latency?
The Premium plan provides pre-warmed instances that eliminate cold start by keeping instances ready. The Consumption plan deallocates instances after idle periods. Timeout (A) does not affect startup time. Output bindings (B) are unrelated. Synchronous I/O (D) does not help with cold starts.
See more: Function App
Question 35MEDIUM
You need to generate a shared access signature (SAS) for an Azure Storage container that allows read access for the next 24 hours and is associated with a stored access policy.
What is the benefit of using a stored access policy with SAS?
A stored access policy allows you to revoke a SAS token by modifying or deleting the policy. Without a stored access policy, an ad hoc SAS cannot be revoked (you would need to regenerate the storage key). It does not shorten the token (A), enable multi-region (C), or auto-renew (D).
See more: Azure Storage Accounts
Question 36MEDIUM
You are implementing managed identities for an Azure Function that needs to access both Azure Key Vault and Azure Cosmos DB.
How many managed identities does the function need?
A single system-assigned managed identity can be granted RBAC roles on multiple Azure resources. You grant the identity appropriate roles on both Key Vault and Cosmos DB. Separate identities (B) are not required. There is no single-service limit (C) or subscription limit (D).
See more: Azure Authentication
Question 37MEDIUM
You are implementing Azure API Management caching. You want to cache GET responses for 30 minutes.
Which policy configuration achieves this?
APIM caching requires cache-lookup in the inbound section (to check the cache before forwarding) and cache-store in the outbound section (to cache the response). Duration is in seconds (1800 = 30 minutes). Placing them in wrong sections (A, B) does not work correctly. Cache-Control header (C) controls client caching, not APIM caching.
See more: Consuming Azure Services
Question 38EASY
You need to implement event-driven architecture in Azure. You want to react to blob creation events from Azure Storage.
Which service provides built-in integration with Azure Storage events?
Azure Event Grid has built-in integration with Azure Storage and publishes events for blob creation, deletion, and other operations. Service Bus (A) is for messaging. Queue Storage (B) requires manual integration. Notification Hubs (D) is for push notifications.
See more: Event-Based Solutions
Question 39MEDIUM
You need to configure Azure Key Vault network access. You want to allow access only from your application's VNet subnet and block all other traffic.
Which networking configuration should you use?
Configure a service endpoint for Microsoft.KeyVault on the subnet, set the Key Vault firewall default action to Deny, and add the subnet as an allowed virtual network. Public access (A) allows all traffic. Private DNS (C) alone does not restrict access. Managed identity (D) handles authentication, not network access.
See more: Data Encryption
Question 40MEDIUM
You are implementing Application Insights custom events and metrics. You want to track a specific business event (e.g., user completes purchase).
Which TelemetryClient method should you use?
TrackEvent sends a custom event with optional custom properties and metrics. It is designed for tracking specific business events. TrackMetric (B) sends a single metric value. TrackTrace (C) sends diagnostic log messages. TrackRequest (D) tracks incoming requests.
See more: Application Insights
Question 41HARD
You are implementing Cosmos DB hierarchical partition keys. Your multi-tenant application stores data for tenants, and within each tenant, data is organized by date.
What is the structure for a hierarchical partition key?
Hierarchical partition keys (sub-partitioning) allows up to 3 levels of partition key paths. You define them as an array like ["/tenantId", "/date"]. Concatenation (A) creates large partitions. Separate containers (B) complicate queries. Composite indexes (D) optimize queries but do not partition data.
See more: CosmosDB
Question 42MEDIUM
You are developing an Azure Function with a Service Bus trigger. The function throws an exception during processing.
What happens to the message?
When a Service Bus triggered function throws an exception, the message is abandoned (not completed). It returns to the queue and is available for retry. After exceeding MaxDeliveryCount, it moves to the dead-letter queue. The message is not deleted (A), not immediately retried (C), and not sent to a separate error queue (D).
See more: Application Messaging
Question 43MEDIUM
You need to configure Azure Blob Storage access tiers at the blob level. Which statement is true about the Archive access tier?
Archive tier blobs are offline and must be rehydrated to Hot or Cool tier before reading. Rehydration can take hours (standard priority) or minutes (high priority). They cannot be read directly (B). Archive tier is for block blobs only (C is wrong). There are early deletion fees (D).
See more: Azure Storage Accounts
Question 44MEDIUM
You are configuring Azure API Management backend authentication. Your backend API requires a client certificate.
Which policy should you use?
The authentication-certificate policy sends a client certificate to the backend service for mutual TLS authentication. validate-jwt (A) validates incoming JWT tokens. authentication-basic (B) sends basic auth credentials. set-header (C) adds a header but does not handle certificate negotiation.
See more: Consuming Azure Services
Question 45MEDIUM
You are implementing Event Hub consumer groups. Your application has three different processing pipelines that need to read all events from the event hub independently.
How many consumer groups do you need?
Each consumer group provides an independent view of the event stream. Three processing pipelines that each need all events require three consumer groups. One group with 3 consumers (A) would split partitions among consumers. Consumer groups are per hub, not per partition (B). Consumer groups are a fundamental concept (D).
See more: Event-Based Solutions
Question 46EASY
You need to rotate a secret stored in Azure Key Vault. Which approach is recommended?
Key Vault supports versioning. Creating a new version of the secret maintains the same secret name while storing the updated value. Applications referencing the secret without a version automatically get the latest. Deleting (A) causes downtime. In-place modification (C) is not how Key Vault works. New names (D) require configuration changes.
See more: Data Encryption
Question 47MEDIUM
You are developing an Azure Container Apps application with Dapr integration. Which Dapr building block helps with service-to-service invocation?
The Dapr service invocation building block enables service-to-service communication with service discovery, mTLS, and retries. State management (B) manages key-value state. Pub/sub (C) is for event-driven messaging. Bindings (D) integrate with external systems.
See more: Containers
Question 48MEDIUM
You are implementing token-based authentication for an Azure Storage queue. You need to use Microsoft Entra ID to authenticate.
Which SDK class should you use for authentication?
DefaultAzureCredential from the Azure Identity library automatically discovers the best available authentication method (managed identity, environment variables, Visual Studio, CLI) for Microsoft Entra ID authentication. StorageSharedKeyCredential (A) uses account keys. AzureSasCredential (B) uses SAS tokens. ConnectionString (C) typically uses keys.
See more: Azure Authentication
Question 49MEDIUM
You are implementing a Service Bus topic subscription with dead-lettering. You want messages that match no subscription filter to be dead-lettered.
Which property should you set?
EnableDeadLetteringOnFilterEvaluationExceptions on a subscription dead-letters messages that cause filter evaluation failures. For messages matching no subscription, Azure Service Bus discards them by default. To capture unmatched messages, you need a catch-all subscription. However, this property specifically handles filter evaluation exceptions. Note: messages with no matching subscription are dropped unless you have a $Default subscription.
See more: Application Messaging
Question 50HARD
You are developing an application that must process exactly-once semantics with Azure Service Bus. A consumer processes messages and writes results to a database.
Which pattern achieves exactly-once processing?
True exactly-once processing requires PeekLock mode (at-least-once delivery) combined with idempotent processing (so reprocessed messages produce the same result) and deduplication logic. PeekLock alone (A) guarantees at-least-once, not exactly-once. ReceiveAndDelete (C) can lose messages. Duplicate detection (D) prevents duplicate sends but not duplicate processing.
See more: Application Messaging
← Back to all AZ-204 Practice Tests
Popular Posts
1Z0-830 Java SE 21 Developer Certification
1Z0-819 Java SE 11 Developer Certification
1Z0-829 Java SE 17 Developer Certification
AWS AI Practitioner Certification
AZ-204 Azure Developer Associate Certification
AZ-305 Azure Solutions Architect Expert Certification
AZ-400 Azure DevOps Engineer Expert Certification
DP-100 Azure Data Scientist Associate Certification
AZ-900 Azure Fundamentals Certification
PL-300 Power BI Data Analyst Certification
Spring Professional Certification
Azure AI Foundry Hello World
Azure AI Agent Hello World
Foundry vs Hub Projects
Build Agents with SDK
Bing Web Search Agent
Function Calling Agent
Spring Boot + Azure Key Vault Hello World Example
Spring Boot + Elasticsearch + Azure Key Vault Example
Spring Boot Azure AD (Entra ID) OAuth 2.0 Authentication
Deploy Spring Boot App to Azure App Service
Secure Azure App Service using Azure API Management
Deploy Spring Boot JAR to Azure App Service
Deploy Spring Boot + MySQL to Azure App Service
Spring Boot + Azure Managed Identity Example
Secure Spring Boot Azure Web App with Managed Identity + App Registration
Elasticsearch 8 Security - Integrate Azure AD OIDC