Is possible Host WebApi in Azure Function ?

Aurelio Piccinino 5 Reputation points
2024-07-18T18:33:58.1166667+00:00

Is it possible to host an ASP.NET Core WebApi in an Azure Function? I would like my Azure Function to serve only as an entry point, while the endpoint management is handled by the WebApi. AWS provides this possibility: https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-asp.html. Is there something similar in Azure?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,033 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vahid Ghafarpour 21,710 Reputation points
    2024-07-18T19:12:03.5066667+00:00

    You can indeed host an ASP.NET Core Web API within an Azure Function.

    These articles help you to do it:

    https://learn.microsoft.com/en-us/aspnet/core/tutorials/publish-to-azure-api-management-using-vs?view=aspnetcore-8.0

    https://learn.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-rest-api

    And this is step by step guide

    https://andrewhalil.com/2021/03/05/deploying-a-net-core-web-api-application-to-azure-app-services/

    ** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful **


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.