Azure / azure-event-hubs-c

C client library for Azure Event Hubs https://azure.microsoft.com/services/event-hubs
Other
7 stars 18 forks source link

Connect to Event Hub-compatible endpoint of Azure iot hub failed due to EventHubAuthCBS Status Failed #12

Closed luyaok closed 7 years ago

luyaok commented 7 years ago

I use Receive sample: https://github.com/Azure/azure-event-hubs-c/tree/master/eventhub_client/samples/receive

And edit it to connect to Event Hub-compatible endpoint of Azure iot hub to receive Device-To-Cloud messages.

static const char* connectionString = "Endpoint=[MY Event Hub-compatible endpoint];SharedAccessKeyName=service;SharedAccessKey=[MY SharedAccessKeyValue]";
static const char* eventHubPath     = "messages/events";
static const char* consumerGroup    = "$Default"; //example "$Default"
static const char* partitionId      = "0";        //example "0"

After running I get the following error information:

Error: Time:Wed Apr 5 16:15:39 2017 File:C:\Users\v-luhan\Downloads\azure-event-hubs-c-master\azure-event-hubs-c-master\eventhub_client\src\eventhubreceiver_ll.c Func:_HandleSASTokenAuth Line:264 EventHubAuthCBS Status Failed.

dcristoloveanu commented 7 years ago

@luyaok Sorry for the delay in answering. I believe the issue is with the fact that the eventHubPath must be the compatible eventhub name (it should be the same as the IoTHub name).

I will close this issue, but let me know if this does not solve the problem that you had.

Thanks, /Dan