AZ-204 Quality Control & Assurance 2 — Questions and Answers
Question 1: Which Azure DevOps feature allows you to define and enforce branch policies to prevent direct pushes to the main branch?
- Branch protection rules
- Branch policies (Correct answer)
- Pipeline gates
- Deployment slots
Correct answer: Branch policies
Azure DevOps Branch Policies let you require pull requests, minimum reviewer counts, and status checks before code can be merged to protected branches.
Question 2: When configuring an Azure Load Testing resource, which metric best indicates that a web API is degrading under load?
- Average response time increasing as virtual users increase (Correct answer)
- CPU utilization dropping below 10%
- HTTP 200 response count increasing
- Throughput (req/s) decreasing while error rate stays at 0%
Correct answer: Average response time increasing as virtual users increase
A rising average response time correlated with increasing virtual users signals that the service is struggling to keep up with demand.
Question 3: In Azure Application Insights, what is the purpose of 'Availability Tests'?
- Monitor CPU usage of Azure VMs
- Continuously ping your app endpoints from global locations to detect downtime (Correct answer)
- Generate load against your API to test throughput
- Validate ARM template deployments
Correct answer: Continuously ping your app endpoints from global locations to detect downtime
Availability Tests send synthetic HTTP requests to your URLs from multiple Azure regions on a schedule and alert you when they fail.
Question 4: A developer wants to ensure that every pull request passes unit tests before it can be merged. Which Azure DevOps configuration achieves this?
- Add a status check policy requiring the CI pipeline to succeed (Correct answer)
- Enable auto-complete on pull requests
- Set retention policies on build artifacts
- Configure a release gate on the production stage
Correct answer: Add a status check policy requiring the CI pipeline to succeed
A status check policy tied to a build pipeline blocks merge until the pipeline reports success, enforcing automated test verification on every PR.
Question 5: Which xUnit attribute should you use in a .NET test project to supply multiple sets of inputs to a single test method?
- [Fact]
- [Theory] with [InlineData] (Correct answer)
- [TestMethod] with [DataRow]
- [TestCase]
Correct answer: [Theory] with [InlineData]
In xUnit, [Theory] marks a parameterized test and [InlineData] provides each set of arguments, running the method once per data row.
Question 6: You need to mock an external HTTP dependency in an ASP.NET Core integration test without hitting the real endpoint. What is the recommended approach?
- Replace the HttpClient with a mock using IHttpClientFactory and a custom DelegatingHandler (Correct answer)
- Disable TLS verification on the HttpClient
- Call the real endpoint but ignore its response
- Use a static HttpClient instance shared across tests
Correct answer: Replace the HttpClient with a mock using IHttpClientFactory and a custom DelegatingHandler
A custom DelegatingHandler registered via IHttpClientFactory intercepts outbound requests and returns canned responses without making real network calls.
Question 7: In Azure Monitor, what is a 'diagnostic setting' used for in the context of quality assurance?
- Setting the number of deployment slots on an App Service
- Routing resource logs and metrics to a Log Analytics workspace, storage, or Event Hub for analysis (Correct answer)
- Configuring alert rules on virtual machine scale sets
- Defining the retention policy for Azure Blob Storage
Correct answer: Routing resource logs and metrics to a Log Analytics workspace, storage, or Event Hub for analysis
Diagnostic settings control where a resource's platform logs and metrics are sent, enabling centralized monitoring and post-incident analysis.
Which Azure DevOps feature allows you to define and enforce branch policies to prevent direct pushes to the main branch?