I've created an app and a function with Azure CLI, which has a proper structure, so:
/host.json
/local.settings.json
/mycustomfunction/function.json
/mycustomfunction/index.js
/mycustomfunction/package.json
/node_modules
Source code gets downloaded from BitBucket, deployed with Kudu, built (node_modules are fetched, azure is one of them), everything is green.
When it comes to dependencies there is only one - "azure": "^2.0.0-preview"
But when I run the function on Azure, I get error
2017-09-08T13:59:06.091 JavaScript HTTP trigger function processed a request.
2017-09-08T13:59:06.216 Exception while executing function: Functions.mycustomfunction. mscorlib: Error: Cannot find module 'azure'
at Function.Module._resolveFilename (module.js:469:15)
The same function works fine locally when run with func host start...
What am I doing wrong? :)