Search Tutorials


AZ-204 Practice Test 1 | Developing Azure Solutions | JavaInUse

AZ-204 Developing Azure Solutions - Practice Test 1

Your Progress

0 / 50
Question 1 MEDIUM
You are developing an application that uses Azure Blob Storage. You need to copy a blob from one container to another within the same storage account. The source blob is 500 GB in size. Which approach should you use?
The Start Copy Blob async operation is the most efficient way to copy a blob within the same storage account. It performs a server-side copy without transferring data through the client. Downloading and re-uploading (A) wastes bandwidth and time. AzCopy (C) works but is less efficient for same-account copies. Put Blob (D) has a 5 GB size limit for a single operation. See more: Azure Storage Accounts
Question 2 MEDIUM
You are developing an Azure Function that processes messages from an Azure Service Bus queue. The function occasionally fails during processing. You need to ensure that failed messages are retried up to 3 times before being moved to a dead-letter queue. What should you configure?
The MaxDeliveryCount property on a Service Bus queue controls how many times a message is delivered before it is automatically moved to the dead-letter queue. Setting it to 3 ensures the message is retried 3 times. Function retry policy (A) applies to the function invocation itself, not message redelivery. A try-catch loop (B) would not cause the message to be redelivered. Application Insights (D) is for monitoring, not retry logic. See more: Application Messaging
Question 3 EASY
You need to deploy a containerized application to Azure. The application requires GPU support and must run on a dedicated host. You want to minimize management overhead. Which service should you use?
Azure Container Instances (ACI) supports GPU resources and provides the simplest way to run containers in Azure without managing servers. AKS (B) provides orchestration but has more management overhead. App Service (C) does not support GPU. Virtual Machines (D) require the most management overhead. See more: Containers
Question 4 MEDIUM
You are implementing authentication for a web API using Microsoft Entra ID. The API needs to validate tokens issued by Entra ID and check that the caller has a specific application role. Which claim in the JWT token should you inspect to verify the application role?
The "roles" claim in a JWT token contains the application roles assigned to the caller. The "scp" claim (A) contains delegated permissions (scopes). The "aud" claim (B) identifies the intended audience (resource). The "iss" claim (C) identifies the token issuer. See more: Azure Authentication
Question 5 HARD
You are developing an application that uses Azure Cosmos DB with the SQL API. You need to implement a query that reads data from multiple partitions while minimizing Request Unit (RU) consumption. Which approach should you use?
Including a partition key filter in the WHERE clause allows the query engine to target specific partitions, minimizing the RU cost even in cross-partition scenarios. ORDER BY without a partition key filter (A) causes a fan-out query across all partitions. Change Feed (C) is for processing incremental changes, not general queries. Stored procedures (D) are scoped to a single partition. See more: CosmosDB
Question 6 MEDIUM
You need to store secrets used by your Azure App Service application. The secrets must be rotated automatically and accessed securely without storing credentials in application code. Which solution should you implement?
Azure Key Vault is the recommended service for storing secrets, keys, and certificates. Using managed identity eliminates the need for credentials in code, and Key Vault supports automatic secret rotation. App Service settings (A) do not support automatic rotation. Blob Storage (B) is not designed for secrets management. Environment variables (D) are not available in App Service PaaS. See more: Data Encryption
Question 7 EASY
You are creating an Azure Function triggered by an HTTP request. The function must return a custom HTTP status code of 202 (Accepted). How should you implement the return value?
Returning an IActionResult with StatusCode(202) is the correct way to return a custom HTTP status code from an Azure Function. HttpResponseException (B) is for error responses. function.json (C) does not have a status property for output bindings. Returning a string (D) would result in a 200 OK with the string as the body. See more: Function App
Question 8 MEDIUM
You are implementing an Azure Event Grid subscription to process events from an Azure Blob Storage account. You only want to receive events when blobs are created in a specific container named "uploads". How should you configure the subscription?
Subject filtering with the prefix /blobServices/default/containers/uploads targets only events from the specific container. Event type filtering (B) filters by event type but not by container. Advanced filters on data.api (A) filter by operation type, not container. Creating a separate topic (D) is unnecessary and not supported for storage accounts. See more: Event-Based Solutions
Question 9 MEDIUM
You are configuring Application Insights for an ASP.NET Core web application deployed to Azure App Service. You need to track custom business metrics such as the number of orders processed per minute. Which Application Insights feature should you use?
TelemetryClient.TrackMetric() allows you to send custom metrics to Application Insights, such as business-specific KPIs. Availability tests (A) monitor endpoint uptime. Live Metrics Stream (C) shows real-time telemetry but does not create custom metrics. Application Map (D) shows application component dependencies. See more: Application Insights
Question 10 MEDIUM
You are designing an API solution using Azure API Management. You need to limit the rate of API calls to 100 calls per minute per subscription key. Which policy should you use?
The rate-limit-by-key policy restricts the call rate per specified key (e.g., subscription key) within a time window. quota-by-key (A) limits the total number of calls over a longer period (e.g., per week) rather than per minute. ip-filter (B) restricts access by IP address. validate-jwt (C) validates JSON Web Tokens. See more: Consuming Azure Services
Question 11 HARD
You are developing an application that uses Cosmos DB with the SQL API. The application requires strong consistency for reads immediately after writes within the same session, but eventual consistency is acceptable for other sessions. Which consistency level should you choose?
Session consistency guarantees read-your-own-writes within the same session while allowing eventual consistency across sessions. This provides the best balance for the described scenario. Strong consistency (B) provides linearizability across all sessions but at higher latency and cost. Bounded Staleness (C) guarantees reads lag behind writes by a bounded amount. Eventual consistency (D) provides no read-after-write guarantees. See more: CosmosDB
Question 12 MEDIUM
You are building an Azure Container Registry (ACR) and need to automatically purge old container images that are older than 30 days, except for the latest 5 tags. Which feature should you use?
ACR Tasks with the purge command (acr purge) allows you to automatically delete images based on age and tag count criteria. Webhooks (A) notify external services but do not delete images. Geo-replication (B) replicates images across regions. Content trust (D) provides image signing and verification. See more: Containers
Question 13 EASY
You need to create a Shared Access Signature (SAS) token for a blob that allows read access for the next 24 hours. You want to ensure the SAS can be revoked before it expires. Which type of SAS should you create?
A Service SAS with a stored access policy allows you to revoke the SAS at any time by modifying or deleting the stored access policy. An ad hoc SAS (A) cannot be revoked before its expiry. Account SAS (C) provides access at the account level and also cannot be revoked. User delegation SAS (D) uses Entra ID credentials but does not support stored access policies for revocation. See more: Azure Storage Accounts
Question 14 MEDIUM
You are developing an Azure Function that needs to read from Azure Blob Storage and write to Azure Cosmos DB. The function is triggered by an HTTP request. Which binding configuration is correct?
The function is triggered by HTTP, reads from Blob (input binding), and writes to Cosmos DB (output binding). This matches option A. Option B is incorrect because the trigger is HTTP, not Blob. Option C reverses the input/output bindings. Option D uses the wrong trigger type. See more: Function App
Question 15 MEDIUM
You are implementing Azure Blob Storage lifecycle management. You need to move blobs from the Hot tier to the Cool tier after 30 days and delete them after 365 days. What should you configure?
Azure Blob Storage lifecycle management policies allow you to define rules that automatically transition blobs between access tiers and delete them based on age. This is a built-in feature that does not require custom code. Azure Policy (A) is for governance, not data lifecycle. Automation runbooks (B) and Logic Apps (C) could work but add unnecessary complexity. See more: Azure Storage Accounts
Question 16 HARD
You are developing an application that uses Azure Event Hub to ingest telemetry data. You need to process events in order and ensure exactly-once processing semantics. Which approach should you use?
The Event Processor Host with checkpointing ensures ordered processing within a partition, and implementing idempotent processing logic handles duplicate deliveries to achieve effective exactly-once semantics. Multiple consumer groups (A) do not guarantee order. Increasing partitions (C) improves throughput but does not ensure exactly-once processing. Capture (D) archives events but does not process them. See more: Event-Based Solutions
Question 17 EASY
You need to register an application in Microsoft Entra ID to allow users to sign in using their organizational accounts. Which portal section do you use to register the application?
App registrations in Microsoft Entra ID is where you register new applications. Enterprise applications (A) shows applications already registered or provisioned. Groups (B) manages user groups. Conditional access (D) configures access policies. See more: Azure Authentication
Question 18 MEDIUM
You are configuring Azure Key Vault for your application. You need to allow an Azure App Service to access secrets stored in the Key Vault without storing any credentials. Which authentication method should you configure?
A system-assigned managed identity provides an automatically managed identity for the App Service that can be granted access to Key Vault through access policies or RBAC. No credentials need to be stored. Client secret (B) requires storing credentials. Certificate-based auth (C) requires managing certificates. Shared access key (D) is not a Key Vault authentication method. See more: Data Encryption
Question 19 MEDIUM
You are designing an Azure Function App with a Durable Functions orchestrator. The orchestrator needs to call three external APIs in parallel and aggregate the results. Which Durable Functions pattern should you use?
The fan-out/fan-in pattern executes multiple activity functions in parallel and then aggregates all their results. Function chaining (A) executes functions sequentially. Human interaction (B) waits for user input. Monitor pattern (C) polls for a condition at intervals. See more: Function App
Question 20 MEDIUM
You are developing an application that uses Azure Cosmos DB. You need to implement an optimistic concurrency control strategy to prevent lost updates. Which feature should you use?
The ETag (entity tag) with the If-Match header provides optimistic concurrency control in Cosmos DB. Each document has an ETag that changes on every update. By including the If-Match header with the current ETag, the update fails if the document has been modified. Partition key (A) is for data distribution. TTL (C) is for automatic expiration. Stored procedures (D) provide pessimistic concurrency with transactions within a single partition. See more: CosmosDB
Question 21 MEDIUM
You are deploying a multi-container application to Azure Container Instances. The containers need to share a file system volume. Which volume type should you use?
Azure Files share volumes can be mounted by multiple containers in a container group, enabling shared file system access. Azure Disk (A) can only be mounted to a single container. Secret volume (B) stores sensitive data, not shared files. Git repo volume (D) clones a Git repository but is read-only. See more: Containers
Question 22 EASY
You are implementing an API Management policy that must transform a JSON response body to remove sensitive fields before returning it to the client. In which policy section should you place this transformation?
The outbound section processes the response before it is sent to the client, making it the correct place for response transformations. Inbound (B) processes the request before it reaches the backend. Backend (C) modifies the request forwarded to the backend service. On-error (D) handles errors. See more: Consuming Azure Services
Question 23 HARD
You have an Azure Function app that uses a Cosmos DB trigger. The function processes change feed events. You notice that the function is processing documents that were updated but not newly created. You want to process only newly created documents. What should you do?
The Cosmos DB change feed delivers both creates and updates. There is no built-in filter for creates only. You need to add custom logic in the function to distinguish between new and updated documents, for example by checking a creation timestamp field. StartFromBeginning (A) controls whether to process from the beginning of the change feed. SQL queries (B) are not used with the change feed trigger. Pre-triggers (C) run before operations, not as event processors. See more: CosmosDB
Question 24 MEDIUM
You need to encrypt data at rest in Azure Blob Storage using your own encryption key stored in Azure Key Vault. What should you configure?
Customer-managed keys (CMK) with Key Vault allow you to use your own encryption key stored in Azure Key Vault for data-at-rest encryption in Blob Storage. Client-side encryption (A) requires managing encryption in your application. Microsoft-managed keys (C) do not let you control the key. Azure Disk Encryption (D) is for VM disks, not Blob Storage. See more: Data Encryption
Question 25 MEDIUM
You are configuring Application Insights for distributed tracing across multiple microservices. You need to correlate requests across services. Which telemetry property is used to link related operations?
Operation_Id is the correlation identifier shared across all telemetry belonging to the same distributed operation. InstrumentationKey (A) identifies the Application Insights resource. SessionId (B) tracks a user session. Cloud_RoleName (D) identifies the service component in the application map. See more: Application Insights
Question 26 MEDIUM
You are developing an Azure Function with a Timer trigger that runs every 5 minutes. Which CRON expression should you use?
Azure Functions uses a 6-field CRON expression: {second} {minute} {hour} {day} {month} {day-of-week}. "0 */5 * * * *" means at second 0 of every 5th minute. Option B uses a 5-field format (not valid in Azure Functions). Option C runs every 5 hours. Option D runs at minute 5 of every hour. See more: Function App
Question 27 MEDIUM
You need to configure Azure Blob Storage to automatically move blobs to the Archive tier when they have not been accessed for 90 days. Which storage feature must be enabled first?
To use lifecycle management rules based on last access time, you must first enable last access time tracking on the storage account. Soft delete (A) is for recovery of deleted blobs. Versioning (B) maintains previous versions of blobs. Change feed (C) provides a log of changes to blobs. See more: Azure Storage Accounts
Question 28 EASY
You are developing an application that needs to send messages to Azure Service Bus. Messages must be processed in strict FIFO order. Which feature should you use?
Service Bus sessions guarantee FIFO (first-in, first-out) message processing by grouping related messages together. Topics with subscriptions (A) are for pub/sub scenarios. Duplicate detection (C) avoids duplicates but does not guarantee order. A regular queue (D) provides at-most ordering but does not guarantee strict FIFO when multiple consumers are involved. See more: Application Messaging
Question 29 HARD
You are implementing the Microsoft Authentication Library (MSAL) in a single-page application. The app needs to acquire tokens silently for subsequent API calls after the initial login. Which MSAL method should you call first before falling back to an interactive method?
acquireTokenSilent() attempts to get a token from the cache without user interaction. If it fails (e.g., token expired), the application should fall back to an interactive method like loginPopup() or loginRedirect(). loginPopup (A) and loginRedirect (B) require user interaction. acquireTokenByCode (D) is used on the server side for the authorization code flow. See more: Azure Authentication
Question 30 MEDIUM
You are configuring an Azure Event Grid event subscription with a webhook endpoint. The endpoint must validate the subscription before receiving events. Which validation method is used by Event Grid?
Event Grid performs endpoint validation by sending a SubscriptionValidationEvent with a validationCode. The endpoint must return the validationCode in the response to confirm the subscription. This is a synchronous handshake validation. Options B, C, and D are not part of the Event Grid validation protocol. See more: Event-Based Solutions
Question 31 MEDIUM
You are deploying a web app to Azure App Service. You need to implement blue-green deployments to minimize downtime during releases. Which feature should you use?
Deployment slots allow you to deploy to a staging slot and then swap it with the production slot, achieving zero-downtime blue-green deployments. Always On (A) keeps the app running but is not related to deployments. WebJobs (C) are for background tasks. ASE (D) provides an isolated environment but is not specifically for blue-green deployments. See more: Containers
Question 32 MEDIUM
You need to implement a Cosmos DB container that stores both customer profiles and their order history. The most frequent query pattern is to retrieve all orders for a specific customer. What should you use as the partition key?
Using customerId as the partition key ensures that all orders for a customer are in the same partition, making the most frequent query (retrieve all orders for a customer) a single-partition query, which is efficient. orderId (A) would scatter orders across partitions. orderDate (B) would cause hot partitions. documentType (C) provides poor distribution. See more: CosmosDB
Question 33 EASY
You are developing an Azure Function that downloads a large file from blob storage and processes it. The function frequently times out. Which Azure Functions hosting plan should you use to allow longer execution times?
The Dedicated (App Service) plan has no maximum execution time limit, making it suitable for long-running functions. The Consumption plan (A) has a maximum timeout of 10 minutes. The Premium plan (B) allows up to 60 minutes but VNET integration is unrelated to timeouts. Durable Functions (D) can help with long workflows but still run on the Consumption plan with its limitations. See more: Function App
Question 34 MEDIUM
You need to implement Azure Storage Queue message processing with visibility timeout. A consumer reads a message but crashes before deleting it. What happens to the message?
When a consumer reads a message from Azure Storage Queue, the message becomes invisible for the duration of the visibility timeout. If the consumer crashes and does not delete the message, it becomes visible again after the timeout expires, allowing another consumer to process it. Azure Storage Queues do not have a built-in dead-letter queue (C). See more: Application Messaging
Question 35 HARD
You are implementing the OAuth 2.0 authorization code flow with PKCE for a mobile application using Microsoft Entra ID. What is the primary purpose of the code_verifier and code_challenge?
PKCE (Proof Key for Code Exchange) uses code_verifier and code_challenge to prevent authorization code interception attacks. The client creates a code_verifier, sends a code_challenge (derived from it) with the authorization request, and then proves possession of the code_verifier when exchanging the code for tokens. It does not encrypt the code (A), identify users (C), or validate redirects (D). See more: Azure Authentication
Question 36 MEDIUM
You are setting up Application Insights alerts. You want to be notified when the average server response time exceeds 5 seconds for more than 5 minutes. Which alert type should you configure?
A metric alert evaluates metric conditions at regular intervals and triggers when conditions are met. Server response time is a standard metric. Activity log alerts (A) monitor resource management operations. Smart detection (B) uses AI to detect anomalies automatically. Log search alerts (D) query log data, which is more complex than needed here. See more: Application Insights
Question 37 MEDIUM
You deploy a container image to Azure Container Registry (ACR). You need to build the image directly in ACR without using a local Docker installation. Which command should you use?
The "az acr build" command offloads the Docker build process to Azure Container Registry, building the image in the cloud without requiring a local Docker installation. "az acr import" (B) imports existing images from other registries. "docker build" (C) requires local Docker. "az acr create" (D) creates a new registry instance. See more: Containers
Question 38 MEDIUM
You are implementing Azure Key Vault secret rotation. You need to automatically rotate a secret and notify the application when a new version is available. Which feature should you use?
Azure Key Vault integrates with Event Grid to publish events like SecretNearExpiry and SecretExpired. You can use these events to trigger an Azure Function that rotates the secret and notifies the application. Soft delete (A) protects against accidental deletion. Access policies (B) control who can access secrets. Backup and restore (C) is for disaster recovery. See more: Data Encryption
Question 39 EASY
You need to create an Azure Cosmos DB container. Which two properties must you specify during container creation?
A Cosmos DB container requires a name and a partition key at creation time. The partition key cannot be changed after creation. Indexing policy (A) has a default and is optional. Consistency level (C) is set at the account level. Time-to-live (D) is optional. See more: CosmosDB
Question 40 MEDIUM
You are implementing a retry policy for an Azure Function that calls an external REST API. The API occasionally returns HTTP 429 (Too Many Requests) with a Retry-After header. Which retry strategy is most appropriate?
Exponential backoff combined with honoring the Retry-After header is the best strategy for handling 429 responses. It prevents overwhelming the API while respecting the server's rate limiting guidance. Fixed interval (A) may retry too aggressively. Immediate retry (B) will likely trigger more 429 errors. No retry (D) would cause unnecessary failures. See more: Consuming Azure Services
Question 41 MEDIUM
You need to implement Azure Blob Storage immutability. Legal hold has been placed on specific blobs that must not be deleted or modified for regulatory compliance. Which immutability policy should you apply?
A legal hold policy prevents data from being deleted or modified until the hold is explicitly removed, regardless of time. It is designed for legal and regulatory compliance scenarios. Time-based retention (B) has a fixed expiration. Soft delete (C) allows recovery but does not prevent deletion. A read-only lock (D) prevents all modifications to the account, which is too broad. See more: Azure Storage Accounts
Question 42 MEDIUM
You are building a web application that uses Microsoft Graph API to read the signed-in user's profile. Which Microsoft Graph API permission type and scope should you request?
Since the application reads the signed-in user's own profile, it should use delegated permissions (acting on behalf of the user). User.Read is the least-privilege scope for reading the current user's profile. Application permissions (A, B) are for daemon apps without a signed-in user. User.ReadWrite.All (C) grants excessive write access. See more: Azure Authentication
Question 43 MEDIUM
You are configuring Azure Event Grid dead-lettering. When should dead-lettering be configured for an event subscription?
Dead-lettering captures events that fail to be delivered to the endpoint after all retry attempts are exhausted. The undelivered events are stored in a blob storage container for later analysis. Subject filtering (A), batching (C), and data transformation (D) are handled by other Event Grid features. See more: Event-Based Solutions
Question 44 EASY
You are developing an Azure Function that is triggered by a new message in an Azure Storage Queue. What is the maximum message size for Azure Storage Queue messages?
Azure Storage Queue messages have a maximum size of 64 KB. For larger payloads, the common pattern is to store the data in blob storage and include the blob reference in the queue message. Service Bus queues support messages up to 256 KB (Standard) or 100 MB (Premium). See more: Application Messaging
Question 45 HARD
You are implementing Cosmos DB conflict resolution for a multi-region write configuration. You need the most recently written item to always win in case of a conflict. Which conflict resolution mode should you configure?
Last Writer Wins (LWW) using the _ts (timestamp) property ensures the document with the highest timestamp wins in a conflict, which means the most recently written item always prevails. Custom conflict resolution (B) uses custom logic and is not needed for simple last-write-wins. Consistency levels (C, D) do not resolve write conflicts. See more: CosmosDB
Question 46 MEDIUM
You need to implement caching for an API Management backend response. The cache should store responses for 60 seconds and vary by the Accept-Language header. Which policy combination should you use?
The cache-lookup policy in the inbound section checks for a cached response (with vary-by-header to differentiate by Accept-Language), and cache-store in the outbound section saves the backend response to the cache. Option A reverses the placement. Option C uses incorrect policies. Option D is for caching individual values, not full responses. See more: Consuming Azure Services
Question 47 MEDIUM
You are implementing an Azure Function with a Cosmos DB output binding. The function needs to upsert documents (insert if new, update if exists). How should you configure the output binding?
The Azure Functions Cosmos DB output binding uses the Upsert operation by default. If a document with the same id and partition key exists, it is updated; otherwise, it is created. createIfNotExists (A) applies to collections/databases, not documents. Pre-triggers (B) and stored procedures (C) add unnecessary complexity. See more: Function App
Question 48 MEDIUM
You have an Azure App Service that needs to reference secrets from Azure Key Vault directly in application settings without writing code. Which syntax should you use in the App Service configuration?
The @Microsoft.KeyVault() reference syntax in App Service application settings automatically resolves Key Vault secrets at runtime without any code changes. The App Service must have a managed identity with access to the Key Vault. Other syntax options (A, B, D) are not valid Key Vault reference formats. See more: Data Encryption
Question 49 MEDIUM
You need to implement telemetry sampling in Application Insights to reduce the volume of telemetry data while preserving statistical accuracy. Which sampling type maintains correlated telemetry items together?
Adaptive sampling automatically adjusts the sampling rate to maintain a target volume while keeping correlated telemetry items (e.g., request + dependencies + exceptions from the same operation) together. Fixed-rate sampling (B) samples at a constant rate. Ingestion sampling (C) occurs at the Application Insights service endpoint and may break correlations. Log sampling (D) is not a standard Application Insights sampling type. See more: Application Insights
Question 50 HARD
You are implementing a solution that uses Azure Service Bus Topics with message filtering. You need subscribers to receive messages based on custom properties set by the publisher. Which filter type should you use for matching messages with a custom property "priority" equal to "high"?
A SQL filter allows you to write SQL-like expressions to match messages based on custom application properties. The expression "priority = 'high'" filters messages where the custom property "priority" equals "high". Boolean filter (A) either matches all or no messages. Correlation filter (C) matches on standard message properties, not custom ones. Property-based routing (D) does require explicit filter configuration. See more: Application Messaging

← Back to all AZ-204 Practice Tests


Popular Posts