Search code examples
node.jsfunctionazureazure-functions-core-tools

Publish Azure functions when not in root directory


I have node functions that i deploy to Azure functionapp using azure-functions-core-tools.

If I move my functions folders to a subdirectory ex src and run func azure functionapp publish myapp from src, only the functions code is packed and deployed without the rest of the project. When running from the root-directory and functions are in src, looks like the functions because in subdirectory are not detected and deployed.

Is there a way to indicate the path to the functions when deploying with azure-functions-core-tools from root?

Thanks.


Solution

  • It should be possible, take a look at Azure Functions JavaScript Folder Structure.

    It can be configured using the scriptFile property in file function.json.

    {
      "scriptFile": "../lib/nodeFunction.js",
      "bindings": [
        ...
      ]
    }
    

    Hope it helps!