(Building on the answers provided by HariHaran and user3755846.) Sync is 1-way, from the Azure Repo to the Azure Function. Here's one way to copy the Function Files over to the Azure Repo:
- Go to your Function: Click 'Overview' -> 'Download app content' -> 'Site content'. It will give you a zip file.

- Get your Git URL and Credentials: On your Azure Repo: Click 'Repos' -> 'Clone' -> 'Generate Git Credentials'

- Setup your work environment. We're using Azure CloudShell in the examples below.
PS /home/repo> git config --global user.name "myFirstName myLastName"
PS /home/repo> git config --global user.email "[email protected]"
PS /home/repo> git clone https://[email protected]/myrepo/myproject/_git/myproject
Cloning into 'myproject'...
Password for 'https://[email protected]':
remote: Azure Repos
remote: Found 6 objects to send. (17 ms)
Unpacking objects: 100% (6/6), 1.57 KiB | 1.57 MiB/s, done.
PS /home/repo> ls
myproject
PS /home/repo> cd ./myproject/
PS /home/repo/myproject> ls
README.md
- Unzip the project files you downloaded in Step1
PS /home/repo/myproject> unzip ./myfunction.zip
Archive: ./myfunction.zip
inflating: host.json
inflating: mycode/function.json
inflating: mycode/readme.md
inflating: mycode/run.ps1
inflating: profile.ps1
replace README.md? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
inflating: README.md
inflating: requirements.psd1
PS /home/repo/myproject> rm ./myfunction.zip
PS /home/repo/myproject> ls
host.json mycode profile.ps1 README.md requirements.psd1
- Commit the changes to your repository.
PS /home/repo/myproject> git add .
PS /home/repo/myproject> git commit
[main b065464] Initial Project Commit
6 files changed, 74 insertions(+)
create mode 100644 mycode/function.json
create mode 100644 mycode/readme.md
create mode 100644 mycode/run.ps1
create mode 100644 host.json
create mode 100644 profile.ps1
create mode 100644 requirements.psd1
PS /home/repo/myproject> git push -u origin main
Password for 'https://[email protected]':
Enumerating objects: 10, done.
Counting objects: 100% (10/10), done.
Delta compression using up to 2 threads
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 2.24 KiB | 573.00 KiB/s, done.
Total 9 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Analyzing objects... (9/9) (6 ms)
remote: Storing packfile... done (30 ms)
remote: Storing index... done (43 ms)
To https://dev.azure.com/myrepo/myproject/_git/myproject
e7cf6e0..b065464 main -> main
Branch 'main' set up to track remote branch 'main' from 'origin'.
- Go back to your repo. You should now see your files!
