1
votes

I have multiple azure functions in different .Net projects. I'm not sure whether we are able to deploy multiple functions from different projects into a single azure function app via Azure DevOps.

Generally, we will deploy azure functions as zipping or package, By this way It's replacing the latest project alone. I mean I can't deploy multiple functions from different projects in a single-function app via DevOps. By visual studio, we have some ways to achieve this but not sure via pipelines

Is anyone able to advise me on this ??

Reference

How to deploy multiple Microsoft azure functions from different projects (solutions) to same resource group

Deploying multiple function under same azure function app not working

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?

2

2 Answers

2
votes

According to the answer to this thread. You can try below workaround to achieve this via azure devops pipeline.

1, Create multiple ci pipelines one for each function project to build all the functions projects and publish the build artifacts to azure devops. See example here to build azure function project

2, Create a release pipeline. Add all the artifacts published by above multiple ci pipelines as the artifacts resources of this release pipeline.

enter image description here

3, Add copy files tasks to copy all the function folders into one folder as describe in this thread 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?.

If the build artifacts published in the first step are zipped packages. You need to use Extract files task to unzip the packages before using the copy files task.

4, Merge the bin folders using the copy files too

5, Deploy the final folder which contains all the function folders and merged bin folder using Azure Function App task.

1
votes

This feature is currently not supported AFAIK. Check out GitHub Issue#1106 for more details. If you can, you could put two functions in the same project and deploy together. Check out the Wiki:

the unit of deployment should be the Function App, and not individual functions.