I have a Raspberry Pi running Windows IOT Core, which has been provisioned to an Azure IOT Hub. I'm writing a UWP app and I want to send messages to the IOT Hub, which I think I need Microsoft.Azure.Devices.Client.DeviceClient
to do. DeviceClient needs a connection string, which I can hardcode in the app for testing.
How do I:
- Check if the device the app is running on is provisioned to an IOT Hub?
- Get the connection string for the IOT Hub?
I can't know this information at compile time, and I don't want to rebuild my application for every device/deployment.