Partager via


What is API Management Context Request MatchedParameters?

The API Management public documentation for the request context variable usable in policy expressions at /en-us/azure/api-management/api-management-policy-expressions#ContextVariables declares a property MatchedParameters: IReadOnlyDictionary<string, string> which is a bit ambiguous. Here is some insight learned from Vitalli Kurokhtin.

MatchedParameters collection captures (and only captures) parameters that were present in operation UrlTemplate. Those are path and/or query parameters, but only those query parameters that are in template. So if you have template as:

/user/{uid}/credentials?include={include}

And make request as:

/user/1/credentials?include=password&hash=true

MatchedParameters will have:

uid:1 include:password

Url.Query on the other hand will have:

include:password hash:true

See the operation contract's UrlTemplate parameter at /en-us/rest/api/apimanagement/apioperation/get#operationcontract

Comments

  • Anonymous
    June 20, 2019
    This blog has been moved off the MSDN platform. Find further content and update at https://www.linkedin.com/today/author/daviburgComments are locked as part of the blog migration, so please reach out to your customer support contact for assistance with Microsoft products and services.