@Omar Amalfi Your policy looks good and I have tested the same at my end and couldn't observe any issue.
I am sharing my open API spec that I have used for testing
{
"openapi": "3.0.1",
"info": {
"title": "Download",
"description": "",
"version": "1.0"
},
"servers": [{
"url": "https://{yourapiminstancename}.azure-api.net/download"
}],
"paths": {
"/{dynamic_content}": {
"get": {
"summary": "dynamic_content",
"operationId": "dynamic-content",
"parameters": [{
"name": "dynamic_content",
"in": "path",
"required": true,
"schema": {
"type": ""
}
}, {
"name": "id",
"in": "query",
"schema": {
"type": ""
}
}],
"responses": {
"200": {
"description": null
}
}
}
}
},
"components": {
"securitySchemes": {
"apiKeyHeader": {
"type": "apiKey",
"name": "Ocp-Apim-Subscription-Key",
"in": "header"
},
"apiKeyQuery": {
"type": "apiKey",
"name": "subscription-key",
"in": "query"
}
}
},
"security": [{
"apiKeyHeader": []
}, {
"apiKeyQuery": []
}]
}
Policy:
<policies>
<inbound>
<base />
<set-backend-service base-url="https://google.com/" />
<rewrite-uri template="/{dynamic_content}" copy-unmatched-params="true" />
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
</outbound>
<on-error>
<base />
</on-error>
</policies>
While testing from the portal I have passed the dynamic content and query parameter
I have used the backend URL to be failed (returns 404 error) so the Ocp-Apim-Trace is generated and we can see what backend URL it has called.