0
votes

I'm sending messages through HTTP POST to my Azure Event Hub (to use with IoT Hub and a Blob storage).

These are the HTTP call's settings:
httpcall

Every time I send a message, I get a request, but no message.
azureconf

I've tried:

  • different SAS keys and owners
  • different headers as well as no headers

I've added the headers after finding this question. I also made sure to check the permissions, as it was suggested there, but they were already set to the necessary level.

Noteworthy: for some reason, it did work once with the original settings (marked in yellow on the first image).
working

My questions:
1. Do I need to manually add a service bus endpoint with the same name? I'm assuming when you create an event hub, it automatically creates the service bus for you.
2. Could it be the requests I'm seeing actually have nothing to do with the messages I'm sending?
3. Am I configuring this wrong?

1

1 Answers

4
votes

After doing some more research and trying out different methods, this seems to be the one that works for me:

As an endpoint, you need to use

https://{servicebus-name}.servicebus.windows.net/{eventhub-name}/messages

instead of just

https://{servicebus-name}.servicebus.windows.net/

The content-type and content-encoding headers seem to be necessary as well as another header:

host: {servicebus-name}.servicebus.windows.net;

In the Microsoft Docs they add slightly different headers and use a different URL, but that doesn't work for me. This does.

To answer my own questions in case it can help someone in the future:

  1. Do I need to manually add a service bus endpoint with the same name? I'm assuming when you create an event hub, it automatically creates the service bus for you.

You don't need to manually add a service bus, however you can not configure the service bus that has automatically been created for you. SharedAccessAuthorizationRules can only be applied on namespaces and their children, applying these directly to a service bus is currently not supported.

  1. Could it be the requests I'm seeing actually have nothing to do with the messages I'm sending?

Not all requests are messages, which is normal, but after monitoring activity it did point out that the requests I was receiving were directly related to my devices sending messages.

  1. Am I configuring this wrong?

Yes.