Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure APIM pass through request querystring to backend completely

On Azure APIM I have an operation that has querystring parameters. In the policy I change the backend url and apply a rewrite-uri to alter the url. Only the querystring from the caller is not applied to the backend.

Is it possible to passthrough the incoming querystring directly to the backend without changing anything?

<inbound>
    <base />
    <set-backend-service base-url="https://api.test.eu" />
    <rewrite-uri template="dispatch/gateway/test" />
</inbound>

UPDATE

Fixed by using the folloing:

<set-backend-service base-url="https://api.test.eu" />
<rewrite-uri template="/dispatch/gateway/test" copy-unmatched-params="true" />
like image 920
Mivaweb Avatar asked Aug 05 '26 04:08

Mivaweb


1 Answers

I'm having variable(id) in api request url which will be passed with interface uri

request url - https://hostname.com/apiname/v1/Tasks(guid'(ID)')

<rewrite-uri template="/Projects(guid'(ID)')/Tasks" copy-unmatched-params="true" /> 

as ID is variable, final action id value should be same as request url ID. how to pass variable in rewrite uri.

like image 75
Nikhil Dhabu Avatar answered Aug 10 '26 02:08

Nikhil Dhabu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!