August 31st, 2018

Azure IoT Toolkit supports C#, Go, Java, Node.js, PHP, Python and Ruby to develop Azure IoT application in VS Code

Jun Han
Senior Software Engineer

With the latest release of Azure IoT Toolkit, lots of popular languages are supported to quickly create an Azure IoT application in VS Code: C#, Go, Java, Node.js, PHP, Python and Ruby! (Note: For C#, Java, Node.js and Python, it is based on Azure IoT Hub SDK, while for Go, PHP and Ruby, it is based on Azure IoT Hub REST API.) What’s your favorite programing language? Which language would you like to develop an Azure IoT application?

For scripting languages (Go, Node.js, PHP, Python and Ruby), the steps are pretty easy, you could follow this blog post to quickly make that.

For compiled language (C# and Java), there is one more step compared with the scripting languages, but it is still easy. Let’s see how easy it is to create a Java application for Azure IoT Hub in VS Code.

Prerequisites

Generate Code

  1. Right-click your device and select Generate Code to monitor the device-to-cloud message
  2. In language list, select Java
  3. In code template list, select Send device-to-cloud message
  4. In pop-up file dialog, select the folder for your Java application
  5. A new VS Code window will open

Run Code

  1. Open Integrated Terminal of VS Code
  2. Run mvn clean package to install the required libraries and build the simulated device application
  3. Run java -jar target/simulated-device-1.0.0-with-deps.jar to run the simulated device application
  4. You will see the Java application is running. It is sending the simulated device data to IoT Hub every second.
  5. If you want to monitor the device-to-cloud message in VS Code, you could refer to our Wiki page.

 

If your preferred language is not supported yet, no worry! You could just submit your request in GitHub, or use the REST API to build your application. Let us know what languages you want! Feel free to leave your feedback or suggestion in our GitHub issue !

Useful Resources:

Author

Jun Han
Senior Software Engineer

Jun is a Senior Software Engineer at Microsoft. He focuses on developer tooling in Teams and APIs.

0 comments

Discussion are closed.