Search code examples
azure-functionsazure-functions-core-tools

Is it possible to specify function sub directories / paths?


I'm writing my first azure function project in node.js. I have my project directory, in which exists the host.json and local settings files. As far as I understand it, my individual function folders, in which function.json and my function code exists, must reside as a sibling to the hosts.json file. So, project folders must look something like ...

project-root/
  package.json
  host.json
  function-a/
    function.json
    index.js
  function-b/
    function.json
    index.js

But, is it possible to have a project structure with those function folders nested deeper? Something like the following, perhaps ...

project-root/
  package.json
  host.json
  src/
    function-a/
      function.json
      index.js
    function-b/
      function.json
      index.js

This might be useful if I were to be using TypeScript and would need to the function host to execute out of a dist folder, like below ...

project-root/
  package.json
  host.json
  src/
    function-a/
      function.json
      index.js
    function-b/
      function.json
      index.js
  dist/
    function-a/
    function-b/

I can't seem to get the function host to look into nested directories, though.

Is this possible?


Solution

  • No. Not currently supported. Here is uservoice for the request ...

    https://feedback.azure.com/forums/355860-azure-functions/suggestions/18772849-folders-for-organizing-functions-and-a-treeview-fu