I'm trying to create a Function that is triggered when a message becomes available in an Azure Service Bus subscription. I followed the brief example from the official docs.
Running the app locally via func host start
leads to the following error: "ServiceBusTriggerJS: The binding type 'serviceBusTrigger' is not registered. Please ensure the type is correct and the binding extension is installed."
My setup:
package.json
contains the azure node module: "azure": "^2.2.1-preview"
. Node version is 8.11.
function.json
is as in the example:
{
"disabled": false,
"bindings": [
{
"topicName": "myTopic",
"subscriptionName": "mySubscription",
"connection": "MyServiceBus",
"name": "myQueueItem",
"type": "serviceBusTrigger",
"direction": "in"
}
]
}
local.settings.json
contains connection strings to the Service Bus and a storage account that is necessary for running locally:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=...",
"MyServiceBus": "Endpoint=sb://...servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=..."
}
}
index.js
is the same as the example, too:
module.exports = function (context, myQueueItem) {
context.log('JavaScript queue trigger function processed work item', myQueueItem);
context.done();
};
EDIT: This is similar to this question: The binding type 'serviceBusTrigger' is not registered error in azure functions c# with core tools 2. The problem (and therefore solution) are the same. I find the answer here straight-forward to implement.
func host start
? – brettsam