Using swagger UI with ACA

Arora, Siddhannt 0 Reputation points
2024-02-13T15:15:17.95+00:00

I have an ACA which I have deployed and exposing the same via APIM

In azure function you can create an end point for swagger UI and expose it via APIM and with the Azure functions URL you can access the different end point via swagger UI.

How can we expose different end points via swagger UI for an ACA?

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
419 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MuthuKumaranMurugaachari-MSFT 22,321 Reputation points
    2024-02-15T20:43:26.03+00:00

    Arora, Siddhannt Thanks for providing the details and it looks like you are using AzureExtensions.Swashbuckle to generate Swagger UI in Azure Function.

    If you are creating ASP.NET Core app for ACA, then you can integrate Swashbuckle as described in doc: Get started with Swashbuckle and ASP.NET Core. You need to add UseSwagger() and UseSwaggerUI() in the middleware so that it generates JSON as well as Swagger UI. More detailed step-by-step guide is available in the doc including custom API info to be displayed in UI. I followed a sample available in https://github.com/Azure-Samples/dotNET-FrontEnd-to-BackEnd-on-Azure-Container-Apps/blob/main/src/Store.ProductApi/Program.cs (also https://azure.github.io/aca-dotnet-workshop/aca/01-deploy-api-to-aca/) and deployed the code (product) in ACA and able to see SwaggerUI like below:User's image

    I hope this helps and let me know if any questions.


    If you found the answer to your question helpful, please take a moment to mark it as Yes for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.