ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 204 - AZ-204 discussion

Report
Export

DRAG DROP

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.


Question 204
Correct answer: Question 204

Explanation:

Box 1: on-error

Policies in Azure API Management are divided into inbound, backend, outbound, and on-error.

If there is no on-error section, callers will receive 400 or 500 HTTP response messages if an error condition occurs.

Box 2: context

Box 3: context

Box 4: set-status The return-response policy aborts pipeline execution and returns either a default or custom response to the caller. Default response is 200 OK with no body.

Custom response can be specified via a context variable or policy statements.

Syntax:

<return-response response-variable-name="existing context variable">

<set-header/>

<set-body/>

<set-status/>

</return-response>

Box 5: on-error

Reference:

https://docs.microsoft.com/en-us/azure/api-management/api-management-error-handling-policies

https://docs.microsoft.com/en-us/azure/api-management/api-management-transformation-policies

asked 02/10/2024
Karesa Potts
28 questions
User
0 comments
Sorted by

Leave a comment first