How to debug 500 error from Azure API Management call?

In your Swagger file, make sure it mentions the correct host, basePath and schemes entries. Swashbuckle generated Swagger files tend not to contain those.

Here is an example:

{
"swagger": "2.0",
"info": {
    "title": "Your title",
    "version": "1.0",
    "description": "Your description"
},
"host": "server.host.com",
"basePath": "/api",
"schemes": [
    "https"
],
"consumes": [
    "application/json"
],
"produces": [
    "application/json"
],

Take specific interest in "host", "basePath" and "schemes" and change those according to your API.


I had the same issue. I resolved it by putting the back end API URL on the "Web service URL" of my API in the API Management. So at the time of writing, the steps using the portal would be:

  1. Open your API Management instance
  2. Open the APIs blade
  3. Select your API on the list
  4. Settings tab > Web service URL property