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
ServiceBusOutputBindingFunction.cs
_02-bindings-demo.csproj
host.json
local.settings.json.template

README.md

Azure Functions v2 .NET Core DEMO

02-bindings-demo - output-demo

This example is about how to use output bindings - Function ServiceBusOutputBindingFunction listens on HTTP request and as result writes to ServiceBus queue.

Everything important happens in Function argument definition:

[ServiceBus("items-to-process",
             Connection = "dotnettalks-servicebus-playground_SERVICEBUS", 
             EntityType = EntityType.Queue)] 
             ICollector<string> outputSbQueue,

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.