1

Trying to use Google Vision Api from Bot Framework app hosted on Azure. The code works just fine on local but I get this error when I try it on Azure. Can someone help?

Exception while executing function: Functions.messages. mscorlib: Error: A dynamic link library (DLL) initialization routine failed.
\\?\D:\home\site\wwwroot\messages\node_modules\grpc\src\node\extension_binary\grpc_node.node
    at Error (native)
    at Object.Module._extensions..node (module.js:583:18)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (D:\home\site\wwwroot\messages\node_modules\grpc\src\node\src\grpc_extension.js:38:15)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10).

Here is the package.json that I am using:

  {
  "name": "luisbot",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "dependencies": {
    "@google-cloud/vision": "^0.10.0",
    "botbuilder": "^3.7.0",
    "botbuilder-azure": "3.0.2",
    "botbuilder-location": "^1.0.4"
  },
  "devDependencies": {
    "restify": "^4.3.0"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}

and the error throws while loading the vision api module - at the line mention below

var vision = require('@google-cloud/vision')
Ezequiel Jadib
  • 14,767
  • 2
  • 38
  • 43
  • Could you provide the `package.json` file on your question? – Aaron Chen Mar 21 '17 at 03:05
  • **Hi Aaron - Here is the package.json file:** `{ "name": "luisbot", "version": "1.0.0", "description": "", "main": "index.js", "dependencies": { "@google-cloud/vision": "^0.10.0", "botbuilder": "^3.7.0", "botbuilder-azure": "3.0.2", "botbuilder-location": "^1.0.4" }, "devDependencies": { "restify": "^4.3.0" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC" }` – elankumaran Mar 21 '17 at 04:13
  • facing the same issue only with @google-cloud/pubsub – Rotem Slootzky Jun 11 '17 at 06:57

1 Answers1

0

As of now, using grpc modules from inside the function code is not supported as Functions runtime uses Edge.js for executing JavaScript code and it does not have support for loading native modules. Related issue.

Pragna Gopa
  • 726
  • 3
  • 10
  • 1
    any ETA to adding this ability? right now it's blocking us from using some packages (like @google-cloud/pubsub) , thanks – Rotem Slootzky Jun 11 '17 at 06:58
  • 1
    We are working on moving away from edge. I do not have exact ETA yet. But you can track the feature [here](https://github.com/Azure/azure-webjobs-sdk-script/issues/1319) – Pragna Gopa Jun 12 '17 at 18:42