Azure IoT Edge for Visual Studio Code
Перейти к файлу
Koichi Hirao - MSFT 32e78e7d6b
Update README.md
2021-12-08 17:02:40 -08:00
.github User/marine/packagesupgrade (#615) 2021-11-16 08:51:19 -08:00
.vscode Use Webpack to improve extension performance (#323) 2018-12-13 10:20:28 +08:00
assets Dev/hshami/automatic user for environment (#610) 2021-10-06 12:05:41 -07:00
images prepare release 1.6.0 (#304) 2018-11-23 15:49:59 +08:00
scripts updated vscode.yml and genAiKey.js in scripts 2021-10-05 05:24:27 -07:00
src add missing case for dev container creation (#620) 2021-11-30 16:04:56 -08:00
test User/marine/packagesupgrade (#615) 2021-11-16 08:51:19 -08:00
testResources artificially limit edgeHub/properties.desired/schemaVeraion to 1.1 max 2021-09-30 14:38:12 -07:00
.gitattributes Force EOL of package.json and package-lock.json as LF (#19) 2017-11-28 17:11:51 +08:00
.gitignore Use standalone simulator for VSCode Edge extension (#514) 2019-11-08 06:10:54 +01:00
.vscodeignore Use standalone simulator for VSCode Edge extension (#514) 2019-11-08 06:10:54 +01:00
CHANGELOG.md add missing case for dev container creation (#620) 2021-11-30 16:04:56 -08:00
LICENSE.txt OSS compliance (#45) 2018-03-13 11:42:24 +08:00
README.md Update README.md 2021-12-08 17:02:40 -08:00
ThirdPartyNotice.html 1.8.0-rc (#334) 2019-01-02 16:39:36 +08:00
logo.png Update logo 2017-11-10 12:58:57 +08:00
package-lock.json add missing case for dev container creation (#620) 2021-11-30 16:04:56 -08:00
package.json add missing case for dev container creation (#620) 2021-11-30 16:04:56 -08:00
tsconfig.json Update error telemetry (#544) 2020-05-19 12:43:19 +08:00
tslint.json Allow users to specify whether to install Node.js template (#329) 2018-12-20 16:28:54 +08:00
webpack.config.js User/marine/packagesupgrade (#615) 2021-11-16 08:51:19 -08:00
xvfb.init Create xvfb.init 2021-09-28 14:35:11 -07:00

README.md

Azure IoT Edge for Visual Studio Code

Gitter

Azure IoT Edge extension is now a part of Azure IoT Tools extension pack. We highly recommend installing Azure IoT Tools extension pack, which makes it easy to discover and interact with Azure IoT Hub that power your IoT Edge and device applications. This extension pack can help you:

  • Develop and connect your Azure IoT Applications to Azure. With this extension, you can interact with an Azure IoT Hub, manage connected devices, and enable distributed tracing for your Azure IoT applications.
  • Develop and debug Certifies Azure IoT Devices (including MXChip IoT DevKit, ESP32, Raspberry Pi) to Azure. This extension pack makes it easy to code, build, deploy and debug your IoT applications with popular IoT development boards.
  • Develop and deploy artificial intelligence and your custom logic to Azure IoT Edge. This extension pack makes it easy to code, build, deploy, and debug your IoT Edge applications.

Overview

Azure IoT Edge extension makes it easy to code, build, deploy, and debug your IoT Edge solutions in Visual Studio Code, by providing a rich set of functionalities:

  • Create new IoT Edge solution
  • Add new IoT Edge module to Edge solution
  • Build and publish IoT Edge modules
  • Debug IoT Edge modules locally and remotely
  • IntelliSense and code snippets for the deployment manifest
  • Manage IoT Edge devices and modules in IoT Hub (with Azure IoT Toolkit)
  • Deploy IoT solutions to IoT Edge devices

Added

What's New (v1.25.0)

  • Generate Dev Container definition files with new Edge Solutions.
  • Ability to add Dev Container definition files to existing Edge Solutions.

What's New (v1.22.0)

Changed

  • Allow user to select deployment template when add module
  • Adopt VS Code's 'asWebviewUri' API

Known Issues

Prerequisites for Azure IoT Edge extension

You need to install prerequisites below to make Azure IoT Edge extension work:

Prerequisites for specific language

To develop IoT Edge modules you also need to install following prerequisites for specific language:

C# module prerequisites

C# Functions on IoT Edge prerequisites

Python module prerequisites

Node.js module prerequisites

Java module prerequisites

C module prerequisites

Quickstart

Click the links below to learn how to develop, debug and deploy IoT Edge modules.

FAQ

Q: All too often, I forget to save a config file, and when I build the docker image. Can we auto-save files before build?

A: By default, VS Code requires an explicit action to save your changes to disk, Ctrl+S. However, it's easy to turn on Auto Save

Q: How to work with Python virtual environment?

A: The Python extension manages your virtual environments in the workspace folder. Please refer to Environments and Automatic Activation of Environments in the Terminal for details.

Q: Help me understand IoT Edge deployment manifest.

A: Learn how to use deployment manifests to deploy modules and establish routes

Q: If I run this extension on Linux (e.g. Ubuntu), when executing docker commands (e.g. the Build IoT Edge Module Image command), the terminal shows permission denied errors. How can I fix this, and avoid having to prefix every command manually with sudo?

A: This extension assumes the current user has sufficient privileges to run docker commands. On Linux you can add the current user to the docker group by executing the following commands:

  • To create the group: sudo groupadd docker
  • To add the current user to it: sudo usermod -aG docker $USER

After executing these commands exit your Terminal session and restart Docker (sudo systemctl restart docker). Or you can reboot the machine completely. Check the Post-installation steps for Linux in the Docker documentation for more information on how to manage Docker as a non-root user.

Commands

Press F1 or Ctrl + Shift + P to open command palette, type Azure IoT Edge: to see all the commands:

  • Azure IoT Edge: New IoT Edge Solution: Create an IoT Edge solution.
  • Azure IoT Edge: Add IoT Edge Module: Add a new IoT Edge module to the IoT Edge solution.
  • Azure IoT Edge: Build IoT Edge Module Image: Containerize IoT Edge module from source code.
  • Azure IoT Edge: Build and Push IoT Edge Module Image: Containerize and push IoT Edge module image to a Docker registry.
  • Azure IoT Edge: Build IoT Edge Solution: Build all the IoT Edge module image in the solution and expand deployment manifest.
  • Azure IoT Edge: Build and Push IoT Edge Solution: Build and push all the IoT Edge module image in the solution and expand deployment manifest.
  • Azure IoT Edge: Setup IoT Edge Simulator: Setup IoT Edge Simulator with an edge device connection string.
  • Azure IoT Edge: Build and Run IoT Edge Solution in Simulator: Build all the IoT Edge module image in the solution and expand deployment manifest. Then run the solution in IoT Edge Simulator.
  • Azure IoT Edge: Run IoT Edge Solution in Simulator: Run the solution of the given deployment manifest in IoT Edge Simulator.
  • Azure IoT Edge: Start IoT Edge Hub Simulator for Single Module: Start the IoT Edge Simulator for testing single module. It will ask for the input names of the module.
  • Azure IoT Edge: Stop IoT Edge Simulator: Stop IoT Edge Simulator.
  • Azure IoT Edge: Set Module Credentials to User Settings: Set the module credential into "azure-iot-edge.EdgeHubConnectionString" and "azure-iot-edge.EdgeModuleCACertificateFile" in user settings. The credentials could be used to connect IoT Edge Simulator.
  • Azure IoT Edge: Create deployment for Edge device: Create and submit the deployment to your IoT Edge device with specified deployment manifest.

You can also trigger following frequently-used commands in context menu.

  • Azure IoT Edge: Add IoT Edge Module: The context menu of deployment.template.json file or modules folder in VS Code file explorer. A new module will be added to the modules folder.
  • Azure IoT Edge: Build IoT Edge Solution: The context menu of deployment.template.json file in VS Code file explorer.
  • Azure IoT Edge: Build and Push IoT Edge Solution: The context menu of deployment.template.json file in VS Code file explorer.
  • Azure IoT Edge: Build and Run IoT Edge Solution in Simulator: The context menu of deployment.template.json file in VS Code file explorer.
  • Azure IoT Edge: Generate IoT Edge Deployment Manifest: The context menu of deployment.template.json file in VS Code file explorer. The deployment manifest (deployment.json) will be expanded from deployment.template.json.
  • Azure IoT Edge: Build IoT Edge Module Image: The context menu of the module.json file in VS Code file explorer. With the input platform from user, it will build the image with the target Dockerfile.
  • Azure IoT Edge: Build and Push IoT Edge Module Image: The context menu of the module.json file in VS Code file explorer. With the input platform from user, it will build and push image with the target Dockerfile.
  • Azure IoT Edge: Create deployment for Edge device: The context menu of an IoT Edge device in device list. Create a deployment for target IoT Edge device with deployment manifest file you select.
  • Azure IoT Edge: Edit module twin: The context menu of a deployed module in device list. Fetch target module twin and then update it in edit view.

Code Snippets

Trigger Content
edgeModule Add IoT Edge module in IoT Edge deployment manifest
edgeRoute Add IoT Edge route in IoT Edge deployment manifest

Resources

Supported Operating Systems

Currently this extension supports the following operating systems:

  • Windows 7 and later (32-bit and 64-bit)
  • macOS 10.10 and later
  • Ubuntu 16.04

The extension might work on other Linux distros as some users have reported, but be aware that Microsoft provides no guarantee or support for such installations. You can find Azure IoT Edge support here.

TypeEdge (Experimental)

The Azure IoT TypeEdge introduces a strongly-typed flavor of the inherently loosely coupled vanilla Azure IoT Edge. We would like to invite you to try TypeEdge out and give us any feedback or recommendations you might have here. TypeEdge is still an experimental project that we dont recommend to use it in production IoT Edge project.

To get started, please visit the project repo and give us feedback via Github Issues.

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.

Support

The team monitors the issue section on regular basis and will try to assist with troubleshooting or questions related IoT Edge tools on a best effort basis.

A few tips before opening an issue. Try to generalize the problem as much as possible. Examples include

  • Removing 3rd party components
  • Reproduce the issue with provided deployment manifest used
  • Specify whether issue is reproducible on physical device or simulated device or both

Also, Consider consulting on the docker docs channel for general docker questions.