From my local testing NodeJS code without using Azure Function in Visual Studio Code, I could use adal-node code without error:
let AuthenticationContext = require('adal-node').AuthenticationContext;
However, after I copied this above module.exports
in index.js, below error occurred:
[error] Worker was unable to load function ServiceBusQueueTrigger: 'ReferenceError: authenticator is not defined'
Below is package.json settings:
{
"name": "function",
"version": "1.0.0",
"private": true,
"description": "facing adal-node error",
"main": "index.js",
"scripts": {
"test": "echo \"No tests yet...\""
},
"dependencies": {
"adal-node": "^0.2.1",
......
},
"devDependencies": {}
}
Below is launch.json settings:
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Node Functions",
"type": "node",
"request": "attach",
"port": 9229,
"preLaunchTask": "func: host start"
}
]
}
Below is function.json settings:
{
"bindings": [
{
"name": "mySbMsg",
"type": "serviceBusTrigger",
"direction": "in",
"queueName": "myqueue",
"connection": "ServiceBus"
}
]
}