AZ-204 Case Studies & Practical Application 5 — Questions and Answers
Question 1: A developer needs to run a one-time data migration job in Azure that processes 10 million records. The job must finish within 2 hours and should not affect the production App Service. Which compute option is most appropriate?
- Azure Batch with a pool of VMs sized for parallel task execution (Correct answer)
- Azure Functions Consumption plan with a 10-minute timeout
- A WebJob on the existing App Service plan
- Azure Logic Apps with a for-each loop over all records
Correct answer: Azure Batch with a pool of VMs sized for parallel task execution
Azure Batch is purpose-built for large-scale parallel compute jobs, allowing a pool of VMs to process millions of records in parallel without impacting other services.
Question 2: A SaaS application uses Azure AD B2C for customer identity. After login, the app's API must know the user's subscription tier stored in B2C. How should this be included in the token?
- Use a custom user attribute in B2C and add it as a claim to the token via a user flow (Correct answer)
- Query the Microsoft Graph API on every API request to fetch the subscription tier
- Store the tier in a cookie alongside the ID token
- Add the tier to the token using Azure API Management's set-header policy
Correct answer: Use a custom user attribute in B2C and add it as a claim to the token via a user flow
B2C custom attributes can be included as token claims through user flow configuration, embedding application-specific data directly in the JWT without additional API calls.
Question 3: A developer implements an Azure Durable Function orchestrator that calls three activity functions in parallel and waits for all to complete. Which Durable Functions pattern does this represent?
- Fan-out/fan-in using Task.WhenAll on multiple activity calls (Correct answer)
- Chaining with sequential await calls on each activity
- Monitor pattern using a while loop with timers
- Human interaction pattern with external event waiting
Correct answer: Fan-out/fan-in using Task.WhenAll on multiple activity calls
Fan-out/fan-in starts multiple activity functions simultaneously and uses Task.WhenAll to aggregate results, enabling parallel execution within a single orchestration.
Question 4: A developer is securing an Azure Function HTTP trigger. It should only accept requests from a specific Azure Front Door instance. What is the recommended approach?
- Validate the X-Azure-FDID header against the expected Front Door ID and use IP restriction to allow only Front Door's service tags (Correct answer)
- Set the function auth level to 'function' and share the key with Front Door
- Enable Azure AD authentication on the function and configure Front Door as a trusted caller
- Use an API Management gateway between Front Door and the function
Correct answer: Validate the X-Azure-FDID header against the expected Front Door ID and use IP restriction to allow only Front Door's service tags
Validating the X-Azure-FDID header combined with IP restrictions on the AzureFrontDoor.Backend service tag ensures only your specific Front Door instance can reach the function.
Question 5: An application uses Azure Table Storage for telemetry data partitioned by DeviceId. Queries for a specific device's data over a date range are slow. What should the developer check first?
- Verify the RowKey is set to a time-based value so date-range queries become efficient partition scans (Correct answer)
- Add a secondary index on the timestamp column
- Migrate to Cosmos DB Table API for better query performance
- Increase the storage account tier to Premium
Correct answer: Verify the RowKey is set to a time-based value so date-range queries become efficient partition scans
In Azure Table Storage, using a time-based RowKey with a fixed PartitionKey turns date-range queries into efficient partition-range scans using the built-in primary index.
Question 6: A developer is configuring an Azure App Service deployment slot swap. After the swap, some users on the production slot still see the old version. What is the most likely cause?
- Users have existing affinity cookies routing them to an instance that has not yet processed the swap (Correct answer)
- The deployment slot swap does not restart existing worker processes
- Azure CDN is caching the old version at edge nodes
- App Service auto-healing restarted the app on the old build
Correct answer: Users have existing affinity cookies routing them to an instance that has not yet processed the swap
ARR affinity cookies pin sessions to specific instances; if an instance was in-flight during the swap, users with that cookie are still routed to it until the cookie expires or is cleared.
Question 7: A developer needs to call an external payment API from Azure Functions with retry logic. The external API returns 429 (Too Many Requests) with a Retry-After header. What is the correct retry behavior?
- Parse the Retry-After header value and delay the next attempt by exactly that duration (Correct answer)
- Apply exponential backoff starting at 1 second regardless of the header
- Immediately retry up to 3 times then throw an exception
- Forward the 429 to the caller and let the client handle retries
Correct answer: Parse the Retry-After header value and delay the next attempt by exactly that duration
Respecting the Retry-After header is required by HTTP standards and prevents further rate-limiting; ignoring it and retrying sooner will cause continued 429 responses.
A developer needs to run a one-time data migration job in Azure that processes 10 million records.
The job must finish within 2 hours and should not affect the production App Service.
Which compute option is most appropriate?