-1

I'm working with multiple teams that develop & test Azure Functions independently from each other but want to deploy all functions to a centralized Azure Function host, like so: Deployment pipeline

The publishing methods I know overwrite the existing content on the host which is not wanted, we strive for an incremental update (similar to this question with the only difference that we use Python on Linux-based host instead of C#).

My question is: What is the easiest way to do this (assuming that hosts.json and function settings are the same for both projects)?

If team A runs

curl -X POST -u <user> --data-binary @"./func1-2.zip" https://<funcname>.scm.azurewebsites.net/api/zipdeploy

in their release pipeline and afterwards team B runs

curl -X POST -u <user> --data-binary @"./func3-4.zip" https://<funcname>.scm.azurewebsites.net/api/zipdeploy

func1 and func2 from team A are gone. Using PUT on the https://<funcname>.scm.azurewebsites.net/api/zip/ endpoint as indicated here didn't seem to publish the functions at all. When using FTP, I don't see any files in site/wwwroot/ at all, even after already publishing functions.

Christian Vorhemus
  • 2,396
  • 1
  • 17
  • 29

1 Answers1

0

You need to use continuous deployment:

First, create a repo on Github, then configure deploy center:

enter image description here

Then use git to upload your local function app to Github:

echo "# xxxxxx" >> README.md
git init
git add .
git commit -m "first commit"
git branch -M main
git remote add origin <git-url>
git push -u origin main

update:

git init
git add .
git commit -m "something"
git branch -M main
git remote add origin <git-url>
git push -u origin main

Refer to this official doc:

https://learn.microsoft.com/en-us/azure/azure-functions/functions-continuous-deployment

Cindy Pau
  • 13,085
  • 1
  • 15
  • 27
  • But that would mean I have a centralized Git repository. That's not wanted in my case, each team should only have their own repository. – Christian Vorhemus Mar 24 '21 at 09:10
  • 1
    @SimonNobel In your case, I think there is no good way to achieve incremental deployment. Most deployment method you can find will overwrite the original project. Continuous deployment is incremental, but continuous deployment does not support multiple repo, and the linux-based function app cannot modify the project by directly uploading files. So, unfortunately there is no way to do it. – Cindy Pau Mar 24 '21 at 09:21