Request Not Going Through API Gateway Microservices

85 views Asked by At

I am using .net core 7 web API project as a API gateway to entry point for my another Microservices deployed on Azure app services. A few days back everything was working fine; now request now going through getting HTTP ERROR 500

I am using ocelot.

Online Service URL :
https://ecomseller20231022190208.azurewebsites.net/api/Seller/GetSellers [Working Directly]

Below is my code:

using Ocelot.DependencyInjection;
using Ocelot.Middleware;

var builder = WebApplication.CreateBuilder(args);
builder.Configuration.SetBasePath(builder.Environment.ContentRootPath)
    .AddJsonFile("ocelot.json",optional: false,true)
    .AddEnvironmentVariables();
builder.Services.AddOcelot(builder.Configuration);

var app = builder.Build();
await app.UseOcelot();
app.Run();

Code of ocelot.json file:

{
  "Routes": [
    // Seller Web API
    {
      "UpstreamPathTemplate": "/api/Seller/GetSellers",
      "UpstreamHttpMethod": ["Get"],
      "DownstreamScheme": "https",
      "DownstreamHostAndPorts": [
        {
          "Host": "https://ecomseller20231022190208.azurewebsites.net",
          "Port": 80
        }
      ],
      "DownstreamPathTemplate": "/api/Seller/GetSellers"
    },
    {
      "UpstreamPathTemplate": "/api/Seller/GetSellers/{SellerId}",
      "UpstreamHttpMethod": ["Get"],
      "DownstreamScheme": "https",
      "DownstreamHostAndPorts": [
        {
          "Host": "https://ecomseller20231022190208.azurewebsites.net",
          "Port": 80
        }
      ],
      "DownstreamPathTemplate": "/api/Seller/GetSellers/{SellerId}"
    }
  ],
  "GlobalConfiguration": {
    //"BaseUrl": "https://ecomseller20231022190208.azurewebsites.net"
  }
}

Please help me understand where and what I am doing wrong.

0

There are 0 answers