The Azure APIM Doesn't Import App Service OpenAPI Spec

Austin Taylor 31 Reputation points
2022-11-23T08:23:02.307+00:00

I'm trying to get the Azure APIM to import the specs from my OpenAPI document created in Swagger, but when I import my App Service into the APIM, it just populates wildcard operations. My App Service is running a .NET 6 API, and I have used Swashbuckle to build the API documentation.

In both my local and deployed environments, I can navigate to {apiUrl}/swagger/v1/swagger.json and view the Swagger JSON file with the specs, so I know they are being generated properly. If I copy the file into editor.swagger.io I can confirm the file has no errors. I can manually import the JSON file into the API within the OpenAPI Specification editor in the Azure Portal and that will import my specifications properly.

I am not sure why the APIM is unable to automatically import the specification and continues to use wildcard operations when I attempt to import it. If I have to continue manually pasting in the JSON file, I guess it's not the end of the world. It just seems like an unnecessary pain after taking the time to properly set up my project to use the OpenAPI specification.

I also notice if I try to connect to an API in the APIM from the App Service, I get the following error, "Please provide OpenAPI specification for the App."
263384-image.png

Any help with this would be very appreciated!

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,941 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,385 questions
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,613 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,362 questions
0 comments No comments
{count} vote

Accepted answer
  1. MayankBargali-MSFT 69,991 Reputation points
    2022-11-25T05:51:00.35+00:00

    @Austin Taylor Thanks for reaching out. It looks like the configuration issue that the API Definition was not configured correctly at the App Service end.

    To configure API Definition/Spec in App Service:

    • Navigate to App Service Resource
    • Click on "API definition
    • Provide the Url of the API Definition (must be publicly accessible)
    • Save

    264087-image.png

    After you perform the above steps, please try to import the App Service resource, APIM will use the API spec that has been configured.

    Feel free to get me if you need any assistance.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. DragonBe 1 Reputation point
    2022-11-24T11:13:58.293+00:00

    Hi @AustinTailor-4596,

    When you create a new API in the APIM blade, you should have the opportunity to select the URL or a local file and providing additional details of the specification. Have you tried uploading the swagger.json manually instead of using a published URL?

    263941-screenshot-2022-11-24-at-120713.png