Search code examples
azurepostmanazure-api-managementbearer-token

Why don't I see any results when I run my test on Azure API Management


I signed up for an API that retrieves a zip file and downloads it. For this, I received a bearer token.

I have created an apim instance and was looking to test the API I had subscribed to which downloads the file.

When I tested it, the apim instance kept loading and got stuck.

I tested this on Postman and it works perfectly. I got the "200 OK response", but still got weird characters like "�vt�" in my body, but that's probably because I'm retrieving a zip file. But why doesn't it work also within Azure's apim? Are there any extra policies I need to add?


Solution

  • You got the "200 OK response", but still facing the issue, you can try to troubleshoot by following approach:

    1. If Backend section is taking most of the time (approx. 5 seconds), which means there is some slowness or long running operation is taking place at the backend.

    • Once you have isolated that the slowness is at the backend, you need to investigate the backend application code of the Web API application. For scenarios where you don't have access to the backend, you can implement caching at APIM level like below. Read about how you can implement caching policies to improve performance in Azure API Management.
    <?xml version="1.0" encoding="UTF-8"?>
    <policies>
       <inbound>
          <base />
          <cache-lookup vary-by-developer="true" vary-by-developer-groups="true" must-revalidate="true" downstream-caching-type="public" />
       </inbound>
       <backend>
          <base />
       </backend>
       <outbound>
          <base />
          <cache-store duration="60" />
       </outbound>
       <on-error>
          <base />
       </on-error>
    </policies>
    

    You can refer to REST API service when called from azure APIM returning empty response body with Status code 200, Azure API Management returning 200 status without response body, gzip Compression, and Azure API management gives 200 response code,