0

Event hub trigger binding registration failing when deploying the code from zipped code in a storage account using the app setting, WEBSITE_RUN_FROM_PACKAGE. Giving the following error:

The binding type(s) eventHubTrigger are not registered

The same code works fine when unzipped deployed through VS code.

Host.json

{
  "version": "2.0",
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[2.*, 3.0.0)"
}

Function.json

{
  "bindings": [
    {
      "type": "eventHubTrigger",
      "name": "myEventHubMessage",
      "direction": "in",
      "eventHubName": "eventHubName",
      "connection": "myEventHubReadConnectionAppSetting"
    }
  ]
}

2 Answers2

0

Update the host.json and Add "extensions"

{
"version": "2.0",

"extensions": {
    "blobs": {},
    "cosmosDb": {},
    "durableTask": {},
    "eventHubs": {},
    "http": {},
    "queues": {},
    "sendGrid": {},
    "serviceBus": {}
},

"extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[2.*, 3.0.0)"
}}
0
  • Used the above tip of mentioning the extension explicitly in the host.json
  • Moved the host.json to the one level above the code folder, I was keeping that at the same level.

PS: This was working with VS code deployments using Azure function extension - as when the host.json is not detected on the root level, VS code auto installs the extension based on the trigger specified in functions.json