Azure function not receiving json messages using Topic Service Bus Trigger

May 25, 2017

While developing an Azure Function application, using this tutorial, I encountered a problem.

Ultimately, using func new generated my function (the run.csx file) which looked like this:

Side note: the mySbMsg is important – it’s defined in the function.json bindings, and must match.
function.json

However, there was a problem.
When sending messages to my topic, they weren’t being picked up by my function.

I was using some very simplistic code to send messages to my topic:

The messages were definitely being delievered to the topic – I could see that in the Azure portal.

However, the function wasn’t picking them up.

The issue was around the string mySbMsg parameter.
The scaffolding assumed that it would be a string – but it is in fact, a byte[] (due to me serializing the JSON)

Changing this parameter to be a byte[] – and my messages are now received by my locally running function.


TAGS: - -


# Back