AZ-204 Professional Standards & Competencies 4 — Questions and Answers
Question 1: A developer is implementing health checks for an Azure App Service. What is the professional best practice for the health check endpoint?
- Return HTTP 200 only when the database and downstream dependencies are reachable (Correct answer)
- Always return HTTP 200 regardless of internal state
- Return HTTP 500 to trigger auto-scaling
- Use the /ping endpoint that returns the server IP address
Correct answer: Return HTTP 200 only when the database and downstream dependencies are reachable
A meaningful health check validates that the app and its dependencies are fully operational, allowing App Service to route away from unhealthy instances.
Question 2: When using Azure Event Grid for event-driven architecture, what professional practice ensures event delivery reliability?
- Using dead-letter destinations and retry policies for undelivered events (Correct answer)
- Ignoring delivery failures and relying on re-publication
- Setting the event TTL to 1 second
- Disabling retry policies to reduce API calls
Correct answer: Using dead-letter destinations and retry policies for undelivered events
Configuring dead-letter destinations and retry policies ensures that undeliverable events are captured for investigation rather than silently dropped.
Question 3: An AZ-204 developer must enforce API throttling to protect a backend service. Which Azure API Management policy implements per-subscription rate limiting?
- set-header policy
- rate-limit-by-key policy using subscription key (Correct answer)
- validate-jwt policy
- rewrite-uri policy
Correct answer: rate-limit-by-key policy using subscription key
The rate-limit-by-key policy restricts the number of calls per time window for a given key such as the subscription key, protecting the backend from overload.
Question 4: A developer is adopting trunk-based development for an Azure DevOps project. What professional standard does this practice support?
- Maintaining long-lived feature branches for each team member
- Continuous Integration by committing small changes frequently to the main branch (Correct answer)
- Using a separate repository per environment
- Deploying directly to production without testing
Correct answer: Continuous Integration by committing small changes frequently to the main branch
Trunk-based development encourages frequent, small commits to the main branch, enabling continuous integration and reducing merge conflicts.
Question 5: An Azure developer wants to ensure container images are free of known vulnerabilities before deployment. Which Azure service provides automated image scanning?
- Azure Container Registry with Microsoft Defender for Containers (Correct answer)
- Azure Blob Storage with virus scanning webhook
- Azure Monitor with container log analysis
- Azure CDN with request inspection rules
Correct answer: Azure Container Registry with Microsoft Defender for Containers
Microsoft Defender for Containers integrates with Azure Container Registry to automatically scan images for OS and application vulnerabilities.
Question 6: A developer needs to implement idempotent message processing in Azure Service Bus. Which design pattern achieves this?
- Process each message exactly once by relying on Service Bus duplicate detection
- Track processed message IDs in a store and skip duplicates on redelivery (Correct answer)
- Delete all messages immediately after first receipt without acknowledgment
- Use FIFO ordering to prevent any message from being delivered twice
Correct answer: Track processed message IDs in a store and skip duplicates on redelivery
Storing processed message IDs and skipping duplicates on redelivery ensures the consumer handles the same message multiple times without side effects.
Question 7: A developer is designing an Azure Function with a timer trigger for a nightly batch job. Which professional practice prevents overlapping executions if a run takes longer than expected?
- Setting SingletonAttribute with Mode.Function to ensure only one instance runs (Correct answer)
- Increasing the timer interval to 48 hours
- Using a consumption plan with no concurrency limit
- Deploying multiple function apps with the same timer schedule
Correct answer: Setting SingletonAttribute with Mode.Function to ensure only one instance runs
Applying [Singleton(Mode = SingletonMode.Function)] prevents concurrent executions of the same function, ensuring the timer job runs sequentially.
A developer is implementing health checks for an Azure App Service.
What is the professional best practice for the health check endpoint?