Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure APIM as pure proxy

I am trying to deal with an Backend API(REST) with no swagger documents to be accessed through Azure APIM. I want all the calls directed to the Backend API with me not manually creating GET/PUT/POST for all the resources. My inbound policies for all operations is below '

<policies>
  <inbound>
    <set-variable name="requestPath" value="@(context.Request.Url.Path)" />
    <base/>
    <set-backend-service base-url="https://*****/****/" />
    <rewrite-uri template="@(context.Request.Url.Path)" copy-unmatched-params="true" />
  </inbound>
  <backend>
    <base/>
  </backend>
  <outbound>
    <base/>
  </outbound>
</policies>

` However when hit the APIM i was given

{ "statusCode": 404, "message": "Resource not found" } Any help is appreciated Thanks

like image 833
KEL_Syd Avatar asked Sep 15 '25 19:09

KEL_Syd


1 Answers

The easy way to do this is to create one operation for each HTTP method you support and use /* for the template. This will match any inbound path/query and forward it to the backend.

like image 179
Darrel Miller Avatar answered Sep 18 '25 08:09

Darrel Miller