Reputation: 121
I was given the iothubower SharedAccessKey for an IoT Hub instance I don't have otherwise access.
Using Visual Studio Code I can Set IoT Hub Connection String using the iothubowner credentials and then Create Device to create a device on the IoT Hub.
However, when I try to Start Monitoring Built-in Event Endpoint on that device, I am asked for additional information, namely the Event Hub compatible connection string.
Is this string something I can retrieve using the iothubowner credentials that I've been given? I don't have access to the Azure Portal. I see the structure of the Event Hub compatible connection string consists of a namespace (which I don't know) and the event hub name, in addition to the iothubowner credentials.
Is the namespace and event hub name something I can retrieve using the my credentials? Is there any other way I can monitor events?
Upvotes: 0
Views: 808
Reputation: 2283
Even though there is an accepted answer, I could not quite figure out how to get my Endpoint.
You need to go to your IoT Hub and click on "Built-in endpoints" and there you will find the Entry:
Upvotes: 0
Reputation: 2654
Event Hub compatible endpoint with iothubowner credentials in my case looks something like this:
Endpoint=sb://iothub-ns-{part_of_iot_hub_name}-2052657-6507c44fda.servicebus.windows.net/;SharedAccessKeyName=iothubowner;SharedAccessKey={shared_access_key}=;EntityPath={iot_hub_name}
The namespace looks like this and is not a part of iothubowner credentials(connection string):
iothub-ns-{part_of_iot_hub_name}-2052657-6507c44fda
As you can see, this endpoint cuts the IoT hub name and contains some numbers - which would be really hard to guess. So if you have the namespace, you can construct the endpoint, otherwise, I would say no and you need access to the Azure portal or to log in with 'az command' and retrieve it with Powershell.
Upvotes: 1