SvenGlöckner Thanks for sharing the additional context. You can define an operation with URL as /test1
with needed policy, backend API, configurations etc. Then add a new operation with URL as /
and use send-request
policy to call /test1
and then return the response using return-response
policy. This way default URL will call operation /
and executes the policy defined within the operation.
actual operation (defines /test1
)
sample operation (defines /
)
Policy Snippet:
<send-request mode="new" response-variable-name="redirectResponse" timeout="60" ignore-error="true">
<set-url>https://127.0.0.1/test1</set-url>
<set-method>GET</set-method>
<set-header name="Host" exists-action="override">
<value><apim-name>.azure-api.net</value>
</set-header>
<set-header name="Ocp-Apim-Subscription-Key" exists-action="override">
<value>@(context.Request.Headers.GetValueOrDefault("Ocp-Apim-Subscription-Key", ""))</value>
</set-header>
</send-request>
<return-response response-variable-name="redirectResponse" />
Note, the above policy is just for reference based on https://github.com/Azure/api-management-policy-snippets/blob/master/examples/Loopback%20request%20for%20service%20at%20same%20API%20Management%20service.xml and you can customize it based on your need such as checking additional headers etc.
I hope this helps with your questions and let me know if you have any other.
If you found the answer to your question helpful, please take a moment to mark it as "Yes" for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.