AZ-305 Practice Question: Reviewing a Bicep template that deploys two App Service Environments (ASE) and an Azure…
Exhibit
Refer to the exhibit.
```yaml
# Bicep template snippet
param primaryLocation string = 'eastus'
param secondaryLocation string = 'westus'
resource asePrimary 'Microsoft.Web/hostingEnvironments@2022-03-01' = {
name: 'myAsePrimary'
location: primaryLocation
properties: {
virtualNetwork: {
id: primaryVnet.id
}
}
}
resource aseSecondary 'Microsoft.Web/hostingEnvironments@2022-03-01' = {
name: 'myAseSecondary'
location: secondaryLocation
properties: {
virtualNetwork: {
id: secondaryVnet.id
}
}
}
resource tm 'Microsoft.Network/trafficManagerProfiles@2022-07-01' = {
name: 'myTM'
location: 'global'
properties: {
profileStatus: 'Enabled'
trafficRoutingMethod: 'Priority'
dnsConfig: {
relativeName: 'myapp'
ttl: 60
}
monitorConfig: {
protocol: 'HTTPS'
port: 443
path: '/'
}
endpoints: [
{
name: 'primary-endpoint'
type: 'Microsoft.Network/trafficManagerProfiles/azureEndpoints'
properties: {
targetResourceId: asePrimary.id
endpointStatus: 'Enabled'
priority: 1
}
}
{
name: 'secondary-endpoint'
type: 'Microsoft.Network/trafficManagerProfiles/azureEndpoints'
properties: {
targetResourceId: aseSecondary.id
endpointStatus: 'Enabled'
priority: 2
}
}
]
}
}
```You are reviewing a Bicep template that deploys two App Service Environments (ASE) and an Azure Traffic Manager profile. The exhibit shows the template snippet. What is the expected behavior when the primary ASE becomes unhealthy?
⚠ Common exam trap
A common mix-up: candidates confuse priority routing with performance routing or assume that Traffic Manager requires manual DNS changes for failover, when in fact it automatically handles failover based on endpoint health probes.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Traffic is automatically routed to the secondary ASE with priority 2.
Azure Traffic Manager uses priority routing, which directs all traffic to the primary endpoint (priority 1) as long as it is healthy. When the primary ASE becomes unhealthy, Traffic Manager automatically fails over to the next priority endpoint (priority 2), ensuring continuous availability without manual intervention.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Traffic is stopped until an administrator updates the DNS manually.
Why it's wrong here
Traffic Manager continuously monitors the health of both ASE endpoints and, when the primary endpoint fails, it automatically updates the DNS response to point to the secondary endpoint. No manual administrative DNS change is required because Traffic Manager's health probe triggers failover dynamically. While client-side DNS TTL caches may temporarily delay the rerouting, traffic is not "stopped" but rather redirected after the cached record expires.
- ✗
Traffic is load-balanced between both ASEs based on performance.
Why it's wrong here
Priority routing is specifically designed to send all traffic to the highest-priority (lowest-numbered) healthy endpoint, and the secondary ASE is used only when the primary is unhealthy. It does not distribute requests between the two ASEs based on performance or any other metric — that behavior belongs to the performance or weighted routing methods. Therefore, the claim that traffic is load-balanced between both ASEs is incorrect because priority routing is an active-passive failover model, not an active-active load-balancing model.
- ✓
Traffic is automatically routed to the secondary ASE with priority 2.
Why this is correct
When the primary ASE becomes unhealthy, Traffic Manager's health probe marks it as unavailable and automatically returns the secondary ASE's DNS name (the endpoint with Priority 2) in response to new client DNS queries. This failover happens without any manual intervention, and the redirection remains in effect while the primary endpoint is unhealthy. Because Traffic Manager continuously re-probes endpoints, the secondary ASE continues to receive traffic until the primary is healthy again and can regain Priority 1 status.
- ✗
Traffic continues to be sent to the primary ASE because priority routing only uses the primary.
Why it's wrong here
Priority routing does not "only use the primary" in an absolute sense; it uses the primary endpoint while it is healthy, but if the health probe fails, Traffic Manager immediately fails over to the next priority endpoint. In this scenario, traffic will not continue to the primary ASE because Traffic Manager stops returning the primary's IP address in DNS answers—it instead answers with the secondary's endpoint. This misconception likely assumes Traffic Manager lacks failover logic, but priority routing is explicitly built to redirect traffic away from unhealthy endpoints.
Go deeper
Related to this question
About these practice questions
This AZ-305 question is part of Courseiva's 795-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
You might also like
Similar AZ-305 questions
- Which TWO actions should you take to ensure business continuity for an Azure SQL Managed Instance? (Choose two.)
- A financial services company runs a critical SQL Server database on Azure VMs. They require a failover solution that pro…
- A company runs a stateless web application on Azure VMs. They need to ensure the application remains available in the ev…
- A company runs a critical application on Azure Kubernetes Service (AKS) in a single region. The application is stateless…
- A company runs a web application on Azure VMs in a single region. They need to ensure that if the region fails, the VMs…
Written by Johnson Ajibi, MSc IT Security
Security Systems Architect · founder of Courseiva
This AZ-305 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-305 exam.