Azure is deploying github from a subfolder

I am using Azure features with a GitHub deployment. I would like to place the function in src/server/functionName/ inside the repo, but the deployment only works if the function is placed directly in functionName/

How to deploy functions located in subdirectories?

documentation approves

your hosts.json files and files must be directly at the root of what you are deploying.

but "should" does not mean "must", right?

What I tried:

  • Various combinations of host.json and function.json locations
  • In host.json I install routePrefix , but it seems to only affect the function url: "http": { "routePrefix": "src/server" },
+6
source share
1 answer

There are several ways to customize the deployment process. One way is to add a custom deployment script to the root of the repository. When a .deployment script exists, Azure will run this script as part of the deployment process as detailed here . For instance. you can write a simple script that copies files and directories from your \src\server subdirectory to the root, for example:

 @echo off echo Deploying Functions ... xcopy "%DEPLOYMENT_SOURCE%\src\server" %DEPLOYMENT_TARGET% /Y /S 

If you do not want to .deployment file in your repo, and your requirements are relatively simple, you can also do this using the application settings by adding the application PROJECT parameter to your functional application with a value that is your subdirectory, for example src\server .

+7
source

Source: https://habr.com/ru/post/1012205/


All Articles