Expressions

Expressions enable access to values of the properties defined by various runtime entities (e.g. request headers or body, queryParameters, connection parameters etc.). You can use expressions to assign values to a policy template parameter. Following is a list of all supported expressions with sample usage.

Expression Description
@headers(‘headerName’) Allows access to request headers. headerName is the name of the header for which value will be returned.
@queryParameters(‘queryParamterName’) Allows access to query parameters in request. queryParamterName is the name of the query parameter for which value will be returned.
@connectionParameters(‘connectionParameterName’) Allows access to request’s connection parameters. connectionParameterName is the name of the property defined in connection parameters for which value will be returned.

Usage

Expression Description
http://@headers(‘subdomain’).azure.net This example references a header named subdomain. Assuming abc as the value of this header in incoming request, this expression will evaluate to http://abc.azure.net. In the same way, you can also use http://@queryParameters(‘subdomain’).azure.net and http://@connectionParameters(‘subdomain’).azure.net to access query and connection parameters.