Azure: What is the best way to import custom node modules into an Azure Function?

This is a duplicate Question, please see discussion on Github:

Goal: Import custom modules into Az Fx (i.e. import myModule.js into myFunction)


  1. in Azure Console, node_modules are stored in your services Service Account / Files / / site / wwwroot

  2. If you include a custom node module, myModule.js, at the root level and run serverless deploy it will be packaged in .serverless/.zip. However, it will not appear in wwwroot, which is where it needs to be for importing into myFunction

Challenge: Make sure our custom node modules, myModule.js, make it into wwwroot so we can import them.

Potential Solutions:

  1. After serverless deploy, use azure-cli to upload custom modules - going with this for now

  2. After serverless deploy, manually upload via azure console

  3. Use include in serverless.yml - Issue on github

    you can add packaging information here


    • myMoudle.js
    • src/modules/myModule.js


  1. Is there a certain place I should be placing my custom node modules so serverless gets them into wwwroot?

are there any updates on this issue?