Developing Solutions for Microsoft Azure (AZ-204) Practice Exam

Disable ads (and more) with a membership for a one time $2.99 payment

Developing Solutions for Microsoft Azure Exam. Prepare with flashcards and multiple choice questions, get hints and explanations for each question. Ace your test prep!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which API Management policy is employed to apply a policy based on a condition?

  1. Forward-request

  2. Choose

  3. Return-response

  4. Set-header

The correct answer is: Choose

The "Choose" policy in Azure API Management is specifically designed to apply a set of policies conditionally based on specified criteria. It allows developers to evaluate incoming requests against different conditions and then execute corresponding policies based on those evaluations. This is particularly useful when you have multiple logic branches depending on the request properties, such as headers, query parameters, or other attributes of the request. In this context, when you need to execute different actions based on dynamic conditions, the "Choose" policy acts like a control statement, enabling you to define various routes within your API management flow. Each condition can have its own set of policies that will be applied if that condition is met, giving you great flexibility and control over the API request processing pipeline. The other policies mentioned, such as "Forward-request," "Return-response," and "Set-header," have specific functions and do not inherently include the conditional evaluation capability of evaluating different paths based on circumstances or properties of the request. Instead, they perform single actions like forwarding a request to a backend service, sending a response back to the client, or modifying a header in the request or response, respectively. This makes "Choose" the only appropriate policy for applying logic based on conditions.