AZ-204 Practice Question: Connect to and consume Azure services and third-party services
Exhibit
{
"resources": [
{
"type": "Microsoft.ApiManagement/service/apis",
"apiVersion": "2022-08-01",
"name": "[concat(parameters('apimServiceName'), '/myapi')]",
"properties": {
"displayName": "My API",
"path": "myapi",
"protocols": ["https"],
"serviceUrl": "https://mybackend.azurewebsites.net",
"authenticationSettings": {
"oAuth2": {
"authorizationServerId": "auth-server-1",
"scope": "read write"
}
}
},
"dependsOn": [
"[resourceId('Microsoft.ApiManagement/service/authorizationServers', parameters('apimServiceName'), 'auth-server-1')]"
]
}
]
}Refer to the exhibit. You are deploying an API in Azure API Management using an ARM template. The API is configured to use OAuth 2.0 authentication. The deployment fails with a validation error. What is the most likely cause?
⚠ Common exam trap
A common pitfall is assuming that OAuth 2.0 configuration for an API in Azure API Management can be defined entirely within the API resource itself in an ARM template. In reality, a separate authorization server resource (type 'Microsoft.ApiManagement/service/authorizationServers') must be deployed and referenced by the API's authenticationSettings. If that resource is missing or not properly referenced, the deployment fails with a validation error.
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
✓
The authorization server 'auth-server-1' is not defined in the template.
When an API in Azure API Management is configured to use OAuth 2.0 authentication, the ARM template must include a corresponding authorization server resource (type 'Microsoft.ApiManagement/service/authorizationServers') that defines the OAuth 2.0 provider. The API's authenticationSettings reference this authorization server by name, and if that server is not defined in the template, the deployment fails with a validation error indicating a missing dependency or undefined resource.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The serviceUrl is not a valid URL.
Why it's wrong here
It is a valid URL.
- ✗
The dependsOn array uses resourceId incorrectly.
Why it's wrong here
The resourceId function is used correctly.
- ✗
The protocols array does not include http.
Why it's wrong here
Missing http is allowed; https is sufficient.
- ✓
The authorization server 'auth-server-1' is not defined in the template.
Why this is correct
The dependsOn expects the authorization server resource to exist; if missing, validation fails.
Go deeper
Related to this question
About these practice questions
Courseiva writes every AZ-204 question from scratch — 881 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-204 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-204 exam.