Debugger
Debugger

Reputation: 792

Is it possible to deploy multiple azure functions from different projects can be deployed in single Azure function app via Azure Devops pipeline?

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?

Upvotes: 2

Views: 6576

Answers (3)

Jonathan Harr
Jonathan Harr

Reputation: 41

Adding to Levi Lu's response I'd like to suggest that you could also checkout the various repositories in your pipeline like this:

    resources:
    repositories:
    - repository: azure-functions-1
      type: github
      name: organization/function1
      endpoint: devopsEndPoint

    - repository: azure-functions-2
      type: github
      name:  organization/function1
      endpoint: devopsEndPoint

Then, down in your steps you check out both of the repositories:

- checkout: azure-functions-1
- checkout: azure-functions-2

This way you don't waste time publishing a bunch of artifacts first. Unless that is a requirement that is but you can still do most of the things you planned on doing in each pipeline, only know you do it in one pipeline. You can still test and do all the build steps but now you can have it all in one pipeline.

Upvotes: 0

Levi Lu-MSFT
Levi Lu-MSFT

Reputation: 30343

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.

Upvotes: 2

Harshita Singh
Harshita Singh

Reputation: 4870

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.

Upvotes: 1

Related Questions