Azure IoT Hub extension for Visual Studio Code
Перейти к файлу
Jun Han 80d8187f32
1.5.0-rc (#175)
2018-10-09 13:07:20 +08:00
.vscode Add unit test (#2) 2017-08-16 10:27:41 +08:00
images Prepare 1.2.0 release (#131) 2018-08-03 17:16:37 +08:00
resources (GH-118) Add F# code generation for device to cloud communication (#172) 2018-10-08 10:29:09 +08:00
scripts Separate AI key for prod and test environment (#82) 2018-04-16 15:39:52 +08:00
snippets Only provide module completion in correct JSON path (#57) 2017-12-18 15:16:27 +08:00
src (GH-136) User experience improvement (#173) 2018-10-08 11:15:41 +08:00
test Get module info, copy module connection string (#168) 2018-09-30 15:26:59 +08:00
.gitattributes Force EOF of package.json and package-lock.json as LF 2017-11-29 09:54:59 +08:00
.gitignore Update image path in README 2017-08-21 12:58:53 +08:00
.travis.yml Update VSCE_TOKEN (#143) 2018-08-27 13:46:11 +08:00
.vscodeignore Reduce VSIX size by ignoring unnecessary file at runtime (#59) 2017-12-20 11:49:45 +08:00
CHANGELOG.md 1.5.0-rc (#175) 2018-10-09 13:07:20 +08:00
CONTRIBUTING.md Add CONTRIBUTING.md 2017-03-02 20:14:47 +08:00
LICENSE.txt OSS Compliance (#73) 2018-03-13 11:42:06 +08:00
README.md 1.5.0-rc (#175) 2018-10-09 13:07:20 +08:00
appveyor.yml Fix CI failure due to azure-iothub breaking change 2017-03-01 22:34:19 +08:00
logo.png Change logo folder 2017-03-06 15:21:15 +08:00
package-lock.json Update package-lock.json to fix security vulnerabilities (#142) 2018-08-20 19:16:21 +08:00
package.json 1.5.0-rc (#175) 2018-10-09 13:07:20 +08:00
tsconfig.json Send/monitor message for Event Hub (#1) 2017-02-27 17:13:31 +08:00
tslint.json Update version to 0.2.1, update BI, handle devices with X.509 cert (#9) 2017-08-24 14:40:05 +08:00

README.md

Azure IoT Toolkit

Join the chat at https://gitter.im/Microsoft/azure-iot-toolkit Marketplace Version

Interact with Azure IoT Hub, IoT Device Management, IoT Edge Management, IoT Hub Code Generation.

Device Explorer

The Wiki page includes a comprehensive getting started guide as well as detailed usage instructions of the following features:

  • IoT Hub management
    • Create IoT Hub
    • Select IoT Hub
    • Copy IoT Hub Connection String
    • Generate SAS Token for IoT Hub
  • Device management
    • List devices
    • Get device info
    • Create IoT device
    • Create Edge device
    • Delete device
    • Copy Device Connection String
    • Generate SAS Token for Device
  • Module management
    • List Moudles
    • Get Module Info
    • Create Module
    • Edit Module Twin
    • Invoke Module Direct Method
    • Copy Module Connection String
    • Delete Module
  • Interact with Azure IoT Hub
    • Generate Code for C#, F#, Go, Java, Node.js, PHP, Python, Ruby or REST API
    • Send D2C message to IoT Hub
    • Monitor IoT Hub D2C message
    • Send C2D message to device
    • Monitor C2D message from IoT Hub
    • Invoke Device Direct Method
    • Edit Device Twin
  • Interact with Azure IoT Edge (Install Azure IoT Edge for more IoT Edge support)
    • List Moudles
    • Edit Module Twin
    • Create deployment for Single Device
    • Create Deployment at Scale

Prerequisites

  1. In Explorer of VS Code, click "Azure IoT Hub Devices" in the bottom left corner.

Click Device Explorer

  1. Click "Set IoT Hub Connection String" in context menu.

Set Connection String

  1. An input box will pop up, then enter your IoT Hub Connection String (It is one-time configuration, and please make sure it is IoT Hub Connection String not Device Connection String. The format is HostName=<my-hub>.azure-devices.net;SharedAccessKeyName=<my-policy>;SharedAccessKey=<my-policy-key>).

Enter Connection String

  1. The device list will be shown.

Device Explorer

NOTE: You could also go to File > Preferences > Settings (Code > Preferences > Settings on Mac), update the config of azure-iot-toolkit.iotHubConnectionString to change your IoT Hub Connection String.

Sign in to Azure

Instead of copying and pasting to set IoT Hub Connection String, you could sign in to Azure to select IoT Hub from your Azure Subscription.

  1. Click "Select IoT Hub" in context menu.

Select IoT Hub

  1. If you have not signed in to Azure, a pop-up will show to let you sign in to Azure.
  2. After you sign in, your Azure Subscription list will be shown, then select an Azure Subscription.
  3. Your IoT Hub list will be shown, then select an IoT Hub.
  4. The device list will be shown.

Code Generation

Code Generation

Code Snippets

Trigger Content
iotSendD2CMessage Send D2C message to IoT Hub
iotMonitorD2CMessage Monitor D2C message for IoT Hub
iotSendC2DMessage Send C2D message to device
iotMonitorC2DMessage Monitor C2D message from IoT Hub
iotCallDirectMethods Send direct methods to device
iotReceiveDirectMethods Receive direct methods from IoT Hub

Snippet

After code snippet is created, you need to install corresponding npm package (e.g. azure-iot-device-mqtt) to run the code snippet. If you want to 'Run Code' directly, you need to install Code Runner.

Configuration

IoT Hub Connection String:

{
    "azure-iot-toolkit.iotHubConnectionString": "HostName=<my-hub>.azure-devices.net;SharedAccessKeyName=<my-policy>;SharedAccessKey=<my-policy-key>"
}

Device Connection String:

{
    "azure-iot-toolkit.deviceConnectionString": "HostName=<my-hub>.azure-devices.net;DeviceId=<known-device-id>;SharedAccessKey=<known-device-key>"
}

IoT Hub Consumer Group (default is "$Default"):

{
    "azure-iot-toolkit.iotHubConsumerGroup": "$Default"
}

The time span (in minutes) of monitoring D2C message before current time (default is 0):

{
    "azure-iot-toolkit.monitorD2CBeforeNowInMinutes": 0
}

Whether to show verbose info when monitoring messages (default is false):

{
    "azure-iot-toolkit.showVerboseMessage": false
}

Whether to stringify device-to-cloud messages (default is false):

{ 
    "azure-iot-toolkit.iotHubD2CMessageStringify": false
}

Whether to show IoT Hub info when IoT Hub Connection String is not set (default is true):

{ 
    "azure-iot-toolkit.showIoTHubInfo": true
}

Resources

❤️ Contributors

Thanks to all the contributors!

Data/Telemetry

This project collects usage data and sends it to Microsoft to help improve our products and services. Read our privacy statement to learn more. If you dont wish to send usage data to Microsoft, you can set the telemetry.enableTelemetry setting to false. Learn more in our FAQ.