nerdexam
Microsoft

AZ-204 · Question #233

Drag and Drop Question You are developing a REST web service. Customers will access the service by using an Azure API Management instance. The web service does not correctly handle conflicts…

The correct answer is on-error; context; set-status. The correct policy structure uses 'on-error' as the error-handling section that intercepts backend errors, 'context' to access the response details and check if the body contains the word 'conflict', and 'set-status' to override the HTTP status code from 500 to the correct 409…

Submitted by naveen.iyer· Mar 30, 2026Implement API Management - specifically configuring APIM inbound/outbound/error policies to transform and handle HTTP responses, which falls under the 'Implement Azure security' or 'Connect to and consume Azure services and third-party services' domain of the AZ-204 exam.

Question

Drag and Drop Question You are developing a REST web service. Customers will access the service by using an Azure API Management instance. The web service does not correctly handle conflicts. Instead of returning an HTTP status code of 409, the service returns a status code of 500. The body of the status message contains only the word conflict. You need to ensure that conflicts produce the correct response. How should you complete the policy? To answer, drag the appropriate code segments to the correct locations. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content. NOTE: Each correct selection is worth one point. Answer:

Exhibit

AZ-204 question #233 exhibit

Answer Area

Drag items

servercontexton-errorset-statuswhen-erroroverride-status

Correct arrangement

  • on-error
  • context
  • set-status

Explanation

The correct policy structure uses 'on-error' as the error-handling section that intercepts backend errors, 'context' to access the response details and check if the body contains the word 'conflict', and 'set-status' to override the HTTP status code from 500 to the correct 409 Conflict response. The 'on-error' policy section in Azure API Management is specifically designed to catch and handle errors returned from the backend service, allowing you to transform incorrect responses before they reach the client.

Topics

#Azure API Management#APIM Policies#Error Handling#REST Web Services

Community Discussion

No community discussion yet for this question.

Full AZ-204 Practice