Search code examples
c#azuremonoamqpazure-eventhub

SAS Token auth for azure eventhub with amqp.net lite


I am currently using amqp.net lite with mono for sending messages to azure eventhub from my raspberry pi.

My connection string looks like this: amqps://SendMessage:[url encoded key]@[sb namespace]

This works fine but now I want to use SAS tokens instead. What would a valid connection string look like in this case? Nothing I tried worked for me so far.

P.S. I am not using the official NuGet Package from Microsoft because it doesn't work on mono


Solution

  • Ok the mechanism described here does work. Read the last section titled "Using the Shared Access Signature (at AMQP level)". It describes how to use SAS tokens with Amqp.NET Lite which is pretty low level. Use Azure SB Lite for more simplicity. It is still based on Amqp.NET Lite but offers more abstraction.