Share via

API management backend URL problem with ? character

Anonymous
2025-03-26T13:56:43.1766667+00:00

I added our logic app to API management via standard way: API management -> API -> Add API -> Create from Azure resource. Everything looks fine, API, backend, named value signiture key are created. However when I call it it fails on authorization since backendUrl is not complete (see picture bellow). After extensive tries to change policy (rewrite url, encode/decode url, set-query-parameter in both API policy and backend) nothing worked.

What I found - as long as there is "?" character in URL it fails. I tried to put entire string into named valued as well but same error.

<policies>

    <inbound>

        <base />

        <set-method id="apim-generated-policy">POST</set-method>

        <rewrite-uri id="apim-generated-policy" template="/manual/paths/invoke/?api-version=2016-06-01&sp=/triggers/manual/run&sv=1.0&sig={{czndpla-reqfufipolicyholder-d_manual-invoke_67e4051d6a5c04fdf30de759}}" />

        <set-header id="apim-generated-policy" name="Ocp-Apim-Subscription-Key" exists-action="delete" />

    </inbound>

    <backend>

        <base />

    </backend>

    <outbound>

        <base />

    </outbound>

    <on-error>

        <base />

    </on-error>

</policies>

It results in:

User's image

so everything after ? is missing. I've tried to set with URL safe %3F end decode it but same error. It appears to me that no matter what, ? always splits URL.

When I remove ?, I get "correct" URL except for missing ? character - which of course fails.

I tried it on APIM platform stv2 and stv2.1. Both errors.

0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.