A JavaScript app that connects to IoT Hub from a web browser. Supports sending messages to IoT Hub, C2D messages and Direct Methods. Uses the Eclipse Paho JS lib to send MQTT over WebSockets. Browser must support WebSockets.
- Using Azure IoT Explorer, create a device in your IoT Hub.
- Paste the Device ID into the index.html
clientid
field. - In Azure IoT Explorer, select your device and generate a Connection string with SAS Token.
- Copy the part of the connection string beginning at
SharedAccessSignature sr=...
and paste this into the index.htmlpwd
field. - Paste your IoT Hub FDQN (e.g.
your_iot_hub_name.azure-devices.net
) into the index.htmlhost
field.