5

I have multiple projects with different functions for example

Solution A

  • Project A
    • Function A1
    • Function A2

Solution B

  • Project B
    • Function B1
    • Function B2

I have 1 Resource Group (R1) which has Project A functions. If I deploy Project B functions to Resource Group "R1" its removing Project A functions and replacing it with Project B functions.

Is there way to deploy functions from both Project A and Project B together to same Resource Group (R1)?

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
Mag
  • 179
  • 1
  • 3
  • 6
  • 1
    I'm assuming you're using dotnet runtime for your functions. If yes. You can't do it with off the shelf publish or deploy wizards from Visual Studio etc. You have to pull compiled binaries together from both solutions and if necessary, alter the path for "scriptFile" property in each of the function.json file to correct paths. Then deploy the final set of files to function app service. – Sai Puli May 03 '19 at 20:40
  • maybe not from visual studio, but Azure Function is just a "container" for your functions, you can have as many functions as you would like inside Azure Function. – 4c74356b41 May 03 '19 at 20:47
  • Are they both deploying to the same Function App or different Function Apps? – Mike Oryszak May 06 '19 at 02:09

2 Answers2

5

I test with Visual Studio and it works well.

Your function are overwritten by default is because the value Delete existing files is set to true when you deploy you choose Select Existing.

enter image description here

So yo could Edit your Publish Profile Settings. Uncheck the Remove additional files at destination.

enter image description here

Then you will be able to deploy them together. However the recommend way is to deploy everything as one package.

Community
  • 1
  • 1
George Chen
  • 13,703
  • 2
  • 11
  • 26
  • 1
    I've tested this with VS 2019 Enterprise 16.4.6 and it doesn't work as described. Even if the "Remove additional files at destination" is disabled it still overrides the existing function. – Coz Mar 14 '20 at 12:08
  • What does this correspond to if you need to use a YAML pipeline? – FaCoffee Nov 28 '22 at 16:46
0

George Chen only works if your not zip deploying.

If you used zip method.

  • Delete it.
  • Create a new profile.
  • Uncheck Run from a package file(recommended)
  • Click finish.
  • Follow the steps in George Chen's post

Note. You will need to manually stop the host to delete old functions from your storage and restart the service. Should you need to remove one.

Uncheck Run from package file

John
  • 11
  • 3
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Brian61354270 Apr 21 '20 at 00:40
  • please give some details rather than just link – Shlok Nangia Apr 21 '20 at 10:40