'forward-request' Policy Statement


How to use the "forward-request" Policy Statement to call the backend service for an Azure API service operation?

✍: FYIcenter.com


The "forward-request" Policy Statement allows you to call the backend service, using information provided in the "context.Request" object.

The "forward-request" Statement has the following syntax:

<forward-request timeout="time_in_seconds" follow-redirects="true | false (default)"/>  

Obviously, the "forward-request" statement should only be called in the "backend" policy block.

By default, Azure API management automatically added the "forward-request" into the "backend" policy block at the product level to call the backend service.

But you can override it at the API level or the operation level as shown below:

    <forward-request timeout="60"/>

Note that when "forward-request" statement is executed, Azure will:

  • Get the backend server information (host, port, and protocol, etc.) from "context.Request.Url".
  • Get the request headers information from "context.Request.Headers".
  • Get the request body information from "context.Request.Body".
  • Send the request to the backend server.
  • Wait and receive the response to the backend server.
  • Parse the response to populate the "context.Response" object.


'retry' Policy Statement

'set-method' Policy Statement

Policy to Control Backend Service

⇑⇑ Microsoft Azure API Management Tutorials

2018-01-16, 7248🔥, 0💬