I currently have two resource groups: A and B. Resource group A contain my APIM and one LogicApp. However, I also need to call upon a LogicApp in resource group B.
To do this, I'm trying to manually send a HTTP call to the LogicApp in the other resource group through the APIM Policy.
I've been stuck on this the entire day thus far.
My current policy code looks like this:
<policies>
<inbound>
<base />
<!-- Load query parameter -->
<set-query-parameter name="id" exists-action="override">
<value>@(context.Request.MatchedParameters["id"])</value>
</set-query-parameter>
<!-- Insert the ID into the URL by rewriting it -->
<rewrite-uri template="https://<logicAppAddress>/triggers/manual/paths/invoke/{id}?<otherPartofUrl>" copy-unmatched-params="true" />
<send-request ignore-error="false" timeout="20" response-variable-name="MasterKeyResponse" mode="new">
<!-- How do I get the re-written URL here? -->
<set-url>@( context.Request.Url.Path )</set-url>
<set-method>GET</set-method>
</send-request>
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
</outbound>
<on-error>
<base />
</on-error>
The "id" variable gets put into the address correctly, which is great, seeing as the LogicApp calls upon a CosmosDB to retrieve data and then manipulates it.
However, for some reason, I can't seem to get this rewritten URL into the <set-url> section of the <send-request> function.
I really apologize if this is a stupid question, I'm currently interning and this is the first time working with Azure APIM, so it's all relatively new to me. I couldn't find an answer to this on Stackoverflow.
Or is there a better way to do this? Perhaps I'm overlooking something.
Thank you very much for your help in advance and have a nice day.