How can I deploy multiple function app projects in same azure function container using Isolated model which was possible using the InProcess model ?

NielMohanty-3656 0 Reputation points
2024-12-18T00:32:30.9466667+00:00

I have an Azure function app - appFNCIsolatedContainer

Isolated function app project-1 written in C#: IsolatedFunctionApp1.csproj with below two functions:

- function1

- function2

Isolated function app project-2 written in C#: IsolatedFunctionApp2.csproj with below two functions:

- function3

- function4

How can I deploy above two isolated function app projects - IsolatedFunctionApp1.csproj, IsolatedFunctionApp2.csproj in my function app container - appFNCIsolatedContainer. So that my container can host the functions from both projects:

- function1

- function2

- function3

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

2 answers

Sort by: Most helpful
  1. Pinaki Ghatak 5,310 Reputation points Microsoft Employee
    2024-12-18T12:17:25.5+00:00

    Hello [@NielMohanty-3656](/users/na/?userid=565f71dd-b77a-4810-b9e3-407b196160f1 To deploy multiple isolated function app projects in the same Azure Function container, you can follow these 4 steps:

    1. Create a new Azure Function app with the Isolated process model.
    2. Publish your first isolated function app project (IsolatedFunctionApp1.csproj) to the Azure Function app container using Visual Studio or Azure CLI.
    3. Publish your second isolated function app project (IsolatedFunctionApp2.csproj) to the same Azure Function app container using Visual Studio or Azure CLI.
    4. Verify that both function apps are deployed successfully by checking the logs in the Azure portal or using the Azure CLI. Once both function apps are deployed, you can access all four functions from the same Azure Function app container.

    I hope that this response has addressed your query and helped you overcome your challenges. If so, please mark this response as Answered. This will not only acknowledge our efforts, but also assist other community members who may be looking for similar solutions.


  2. Shireesha Eeraboina (Quadrant Resource LLC) 570 Reputation points Microsoft Vendor
    2024-12-23T07:25:20.93+00:00

    Hi @NielMohanty-3656,

    Thanks for explaining your issue. It looks like when you publish both IsolatedFunctionApp1.csproj and IsolatedFunctionApp2.csproj, the functions from the first project are being replaced by the functions from the second project.

    How to Solve This:

    • Make a new Azure Functions project that includes both IsolatedFunctionApp1 and IsolatedFunctionApp2. This will be your main project.
    • Edit the new projects .csproj file to include references to both function app projects. In the <ItemGroup> section, add project references to both IsolatedFunctionApp1 and IsolatedFunctionApp2. In Program.cs, make sure to configure the host to include functions from both projects. Use HostBuilder to configure and build the host.
    • Publish this combined project to your Azure Function App. This will ensure that all functions are included without overriding each other. After publishing, verify in the Azure Portal or using Kudu that all functions (function1, function2, function3, and function4) are present.

    NOTE: Use the Kudu console to check that both function DLLs are in the bin directory. Also, make sure function names are unique to avoid conflicts.

    Thankyou.

     

    0 comments No comments

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.