Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97355

Azure Function in Visual Studio Code - adal-node package error

$
0
0

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"
    }
  ]
}

Viewing all articles
Browse latest Browse all 97355

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>