Failed to load Swagger API definition for a Newly Published .NET Core 6.0 API

Bill Eisenman 21 Reputation points
2022-10-13T20:52:54.31+00:00

I just pushed a .NET Core 6.0 WebAPI to Azure AppService. When I access the location I receive
the following error issued when accessing the default URL at https://visionsuitecore.azurewebsites.net/index.html below:

Message: Failed to load API definition.

Fetch error
Not Found https://visionsuitecore.azurewebsites.net/v1/swagger.json

My API works perfectly using localhost and within my code, the swagger.json should be located at
https://visionsuitecore.azurewebsites.net/swagger/v1/swagger.json. Further, if I access the URL directly
I can view the contents of the swagger.json as expected.

Why is this and how can I fix it? Please Advise.

Bill Eisenman
FastTrak@Luxsparks .com

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,408 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Arbaz Qureshi 16 Reputation points
    2023-05-01T13:07:48.6333333+00:00

    When you have the same name of API Endpoints in the same controller then it will give this error.

    3 people found this answer helpful.
    0 comments No comments

  2. Chanchal Rawat 1 Reputation point
    2022-10-14T12:06:28.907+00:00

    Dear @Bill Eisenman

    i am able to see the swagger page for your webApp

    250390-swaggerabletoload.png

    looks it is working now