Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
.vscode
.gitignore
README.md
ServiceBusTriggerFunction.cs
_02-bindings-demo.csproj
host.json
local.settings.json.template

README.md

Azure Functions v2 .NET Core DEMO

02-bindings-demo - trigger-demo

This example is about how to use ServiceBus trigger - when is added new item into queue by output-demo, Function ServiceBusTriggerFunction is triggered with item from queue as argument.

Everything important happens in Function argument definition:

[ServiceBusTrigger("items-to-process", Connection = "dotnettalks-servicebus-playground_SERVICEBUS")]string myQueueItem,

First parameter with value items-to-process defines queue name in ServiceBus.

Connection parameter represents connection string to ServiceBus.

Important - this parameter is not directly value with connection string, but it is key for JSON in local.settings.json. So you have to create corresponding value in local.settings.json:

{
    ...

    "dotnettalks-servicebus-playground_SERVICEBUS": "----YOUR-CONNECTION-STRING----",

    ...
}

There is example in local.settings.json.template file.