Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to have an Azure Function App created from multiple .NET projects and have all of the Functions from all of them?

We have an Azure Function App that has multiple Functions, and was created using .NET project (Name: Project1).

We want to add a new Azure function from a different .NET project (Name: Project2) to the existing Azure Function App without overwriting the existing functions that were deployed from Project1. Currently when we deploy Azure Function from Project2 the functions from Project1 gets removed, the Function App contains only the Project2 functions.

We deploy the function using the Azure DevOps release pipelines, and we have also tried publishing from Visual Studio - both behave the same way.

So, is there a way to retain the functions from Project 1 - have functions from both the .NET Projects?

like image 593
Gour Gopal Avatar asked Feb 01 '26 18:02

Gour Gopal


1 Answers

As far as I know, there's no good solution to your needs, but there is a solution which is not so good for your reference.

I have created an function app on azure portal named "huyrFirstFunapp" and there is a function "Function1" in it. Click "Platform features" --> "Advanced tools (Kudu)". enter image description here

In "kudu" page, navigate to "Debug console" --> "CMD" --> "site" --> "wwwroot". You can see the folder "Function1", a "host.json" and if you have imported some external module, you can also see a "bin" folder".

Now open the visual studio which there is another function project in it. Here I have a project named "hurySecondFunapp" and there is a function "Function2" in it. enter image description here

Right click "hurySecondFunapp" and click "Build", it will generate a "bin" folder and a "Function2" folder, you can find them in the directory shown as below screenshot. enter image description here

Then we need to drag the "Function2" folder from local to "kudu" page(to "wwwroot" directory which we have navigated to). "Function1" folder and "Function2" folder will co-exist in the "wwwroot" directory, and then we need to merge the two "bin" folders. If your two functions are very simple and don't use any other modules, we just need to drag the "hurySecondFunapp.dll" and "hurySecondFunapp.pdb" from "bin" folder in local to "bin" folder in "kudu" page(shown as below), then the function app in azure portal will show two functions in it. enter image description here

But if your two functions are complex and use many modules or external dlls, this solution will not be a good way. We need to merge the differences between the two "bin" folders and maybe it will cause many problems. So just a solution for your reference, I'm not sure if it will work fine in your side.

like image 145
Hury Shen Avatar answered Feb 03 '26 07:02

Hury Shen