使用 Visual Studio 2019 开发和调试适用于 Azure IoT Edge 的模块Use Visual Studio 2019 to develop and debug modules for Azure IoT Edge

可以将业务逻辑转变为用于 Azure IoT Edge 的模块。You can turn your business logic into modules for Azure IoT Edge. 本文介绍如何使用 Visual Studio 2019 作为主要工具来开发和调试模块。This article shows you how to use Visual Studio 2019 as the main tool to develop and debug modules.

用于 Visual Studio 的 Azure IoT Edge 工具提供以下优势:The Azure IoT Edge Tools for Visual Studio provides the following benefits:

  • 在本地开发计算机上创建、编辑、构建、运行和调试 Azure IoT Edge 解决方案和模块。Create, edit, build, run, and debug Azure IoT Edge solutions and modules on your local development computer.
  • 通过 Azure IoT 中心将 Azure IoT Edge 解决方案部署到 Azure IoT Edge 设备。Deploy your Azure IoT Edge solution to Azure IoT Edge device via Azure IoT Hub.
  • 在 C 或 C# 中编写 Azure IoT 模块的代码,同时兼具 Visual Studio 开发的所有优势。Code your Azure IoT modules in C or C# while having all of the benefits of Visual Studio development.
  • 使用 UI 管理 Azure IoT Edge 设备和模块。Manage Azure IoT Edge devices and modules with UI.

本文介绍如何使用适用于 Visual Studio 2019 的 Azure IoT Edge 工具开发 IoT Edge 模块。This article shows you how to use the Azure IoT Edge Tools for Visual Studio 2019 to develop your IoT Edge modules. 你还将了解如何将项目部署到 Azure IoT Edge 设备。You also learn how to deploy your project to your Azure IoT Edge device. 目前,Visual Studio 2019 为用 C 和 C# 编写的模块提供支持。Currently, Visual Studio 2019 provides support for modules written in C and C#. 支持的设备体系结构为 Windows X64 和 Linux X64 或 ARM32。The supported device architectures are Windows X64 and Linux X64 or ARM32. 有关支持的操作系统、语言和体系结构的详细信息,请参阅语言和体系结构支持For more information about supported operating systems, languages, and architectures, see Language and architecture support.

必备条件Prerequisites

本文假设你使用运行 Windows 的计算机或虚拟机作为开发计算机。This article assumes that you use a computer or virtual machine running Windows as your development machine. 在 Windows 计算机上,可以开发 Windows 或 Linux 模块。On Windows computers, you can develop either Windows or Linux modules. 若要开发 Windows 模块,请使用运行版本 1809/内部版本 17763 或更高版本的 Windows 计算机。To develop Windows modules, use a Windows computer running version 1809/build 17763 or newer. 若要开发 Linux 模块,请使用符合 Docker Desktop 要求的 Windows 计算机。To develop Linux modules, use a Windows computer that meets the requirements for Docker Desktop.

由于本文使用 Visual Studio 2019 作为主要开发工具,因此请安装 Visual Studio。Because this article uses Visual Studio 2019 as the main development tool, install Visual Studio. 确保在 Visual Studio 2019 安装中包含“Azure 开发”和“使用 C++ 的桌面开发”工作负荷。 Make sure you include the Azure development and Desktop development with C++ workloads in your Visual Studio 2019 installation. 可以修改 Visual Studio 2019 以添加所需的工作负荷。You can Modify Visual Studio 2019 to add the required workloads.

Visual Studio 2019 准备就绪后,还需要以下工具和组件:After your Visual Studio 2019 is ready, you also need the following tools and components:

  • 从 Visual Studio 市场中下载并安装 Azure IoT Edge 工具,以在 Visual Studio 2019 中创建 IoT Edge 项目。Download and install Azure IoT Edge Tools from the Visual Studio marketplace to create an IoT Edge project in Visual Studio 2019.

提示

如果使用的是 Visual Studio 2017,请从 Visual Studio 市场下载并安装适用于 VS 2017 的 Azure IoT Edge 工具If you are using Visual Studio 2017, please download and install Azure IoT Edge Tools for VS 2017 from the Visual Studio marketplace

  • 在开发计算机上下载并安装 Docker 社区版,以生成和运行模块映像。Download and install Docker Community Edition on your development machine to build and run your module images. 需要将 Docker CE 设置为在 Linux 容器模式或 Windows 容器模式下运行。You'll need to set Docker CE to run in either Linux container mode or Windows container mode.

  • 设置本地开发环境,通过安装 Azure IoT EdgeHub 开发工具,调试、运行和测试 IoT Edge 解决方案。Set up your local development environment to debug, run, and test your IoT Edge solution by installing the Azure IoT EdgeHub Dev Tool. 请安装 Python (2.7/3.6+) 和 Pip,然后在终端中运行以下命令安装 iotedgehubdev 包 。Install Python (2.7/3.6+) and Pip and then install the iotedgehubdev package by running the following command in your terminal. 确保 Azure IoT EdgeHub 开发工具版本高于 0.3.0。Make sure your Azure IoT EdgeHub Dev Tool version is greater than 0.3.0.

    pip install --upgrade iotedgehubdev
    
  • 克隆存储库并安装 Vcpkg 库管理器,然后安装适用于 Windows 的 azure-iot-sdk-c 包Clone the repository and install the Vcpkg library manager, and then install the azure-iot-sdk-c package for Windows.

    git clone https://github.com/Microsoft/vcpkg
    cd vcpkg
    bootstrap-vcpkg.bat
    
    vcpkg.exe install azure-iot-sdk-c:x64-windows
    vcpkg.exe --triplet x64-windows integrate install
    
  • Azure 容器注册表Docker 中心Azure Container Registry or Docker Hub.

    提示

    对于原型和测试用途,可以使用本地 Docker 注册表,而不使用云注册表。You can use a local Docker registry for prototype and testing purposes instead of a cloud registry.

  • 若要在设备上测试模块,至少需要一个 IoT Edge 设备和一个活动的 IoT 中心。To test your module on a device, you'll need an active IoT hub with at least one IoT Edge device. 若要将计算机用作 IoT Edge 设备,请按照 LinuxWindows 快速入门中的步骤进行操作。To use your computer as an IoT Edge device, follow the steps in the quickstart for Linux or Windows. 如果正在开发计算机上运行 IoT Edge 守护程序,则可能需要停止 EdgeHub 和 EdgeAgent,然后再在 Visual Studio 中开始开发。If you are running IoT Edge daemon on your development machine, you might need to stop EdgeHub and EdgeAgent before you start development in Visual Studio.

检查工具版本Check your tools version

  1. 在“扩展”菜单上,选择“管理扩展” 。From the Extensions menu, select Manage Extensions. 依次展开“已安装”>“工具”,可在此处找到“Azure IoT Edge Tools for Visual Studio”和“Cloud Explorer for Visual Studio” 。Expand Installed > Tools and you can find Azure IoT Edge Tools for Visual Studio and Cloud Explorer for Visual Studio.

  2. 请记下所安装的版本。Note the installed version. 可将此版本与 Visual Studio Marketplace 中的最新版本(Cloud ExplorerAzure IoT Edge)进行比较You can compare this version with the latest version on Visual Studio Marketplace (Cloud Explorer, Azure IoT Edge)

  3. 如果你的版本比 Visual Studio Marketplace 上的版本旧,则可在 Visual Studio 中更新工具,如以下部分中所示。If your version is older than what's available on Visual Studio Marketplace, update your tools in Visual Studio as shown in the following section.

更新工具Update your tools

  1. 在“管理扩展”窗口中,依次展开“更新”>“Visual Studio Marketplace”,选择“Azure IoT Edge Tools”或“Cloud Explorer for Visual Studio”,再选择“更新” 。In the Manage Extensions window, expand Updates > Visual Studio Marketplace, select Azure IoT Edge Tools or Cloud Explorer for Visual Studio and select Update.

  2. 下载工具更新后,请关闭 Visual Studio 以触发使用 VSIX 安装程序的工具更新。After the tools update is downloaded, close Visual Studio to trigger the tools update using the VSIX installer.

  3. 在安装程序中,选择“确定”进行启动,然后选择“修改”以更新工具 。In the installer, select OK to start and then Modify to update the tools.

  4. 更新完成后,请选择“关闭”并重启 Visual Studio 。After the update is complete, select Close and restart Visual Studio.

创建 Azure IoT Edge 项目Create an Azure IoT Edge project

Visual Studio 中的 Azure IoT Edge 项目模板创建了一个项目,它可部署到 Azure IoT 中心的 Azure IoT Edge 设备。The Azure IoT Edge project template in Visual Studio creates a project that can be deployed to Azure IoT Edge devices in Azure IoT Hub. 首先创建一个 Azure IoT Edge 解决方案,并在该解决方案中生成第一个模块。First you create an Azure IoT Edge solution, and then you generate the first module in that solution. 每一个 IoT Edge 解决方案都可包含多个模块。Each IoT Edge solution can contain more than one module.

提示

Visual Studio 创建的 IoT Edge 项目结构与 Visual Studio Code 中的不同。The IoT Edge project structure created by Visual Studio is not the same as in Visual Studio Code.

  1. 在 Visual Studio 的“新建项目”对话框中,搜索并选择“Azure IoT Edge” 项目,然后单击“下一步” 。In Visual Studio new project dialog, search and select Azure IoT Edge project and click Next. 在“项目配置”窗口中,输入项目的名称并指定位置,然后选择“创建” 。In project configuration window, enter a name for your project and specify the location, and then select Create. 默认的项目名称为 AzureIoTEdgeApp1 。The default project name is AzureIoTEdgeApp1.

    创建新项目

  2. 在“添加 IoT Edge 应用程序和模块” 窗口中,选择“C# 模块” 或“C 模块” ,然后指定模块名称和模块映像存储库。In the Add IoT Edge Application and Module window, select either C# Module or C Module and then specify your module name and module image repository. Visual Studio 使用“localhost:5000/<模块名>自动填充模块名。Visual Studio autopopulates the module name with localhost:5000/<your module name>. 将其替换为你自己的注册表信息。Replace it with your own registry information. 如果使用本地 Docker 注册表进行测试,则可以使用 localhost 。If you use a local Docker registry for testing, then localhost is fine. 如果使用 Azure 容器注册表,那么请从注册表的设置中使用登录服务器。If you use Azure Container Registry, then use the login server from your registry's settings. 登录服务器类似于 <注册表名称> .azurecr.cnThe login server looks like <registry name>.azurecr.cn. 仅替换字符串的 localhost:5000 部分,使最终结果看起来像 <注册表名称>.azurecr.cn/ <模块名称>Only replace the localhost:5000 part of the string so that the final result looks like <registry name>.azurecr.cn/<your module name>. 默认模块名称为“IotEdgeModule1” The default module name is IotEdgeModule1

    添加应用程序和模块

  3. 选择“确定”创建包含使用 C# 或 C 的模块的 Azure IoT Edge 解决方案。 Select OK to create the Azure IoT Edge solution with a module that uses either C# or C.

现在,解决方案中已有 AzureIoTEdgeApp1.Linux.Amd64 项目或 AzureIoTEdgeApp1.Windows.Amd64 项目,还有 IotEdgeModule1 项目。Now you have an AzureIoTEdgeApp1.Linux.Amd64 project or an AzureIoTEdgeApp1.Windows.Amd64 project, and also an IotEdgeModule1 project in your solution. 每个 AzureIoTEdgeApp1 项目包含一个 deployment.template.json 文件,此文件定义了要为 IoT Edge 解决方案生成和部署的模块,并定义了模块之间的路由。Each AzureIoTEdgeApp1 project has a deployment.template.json file, which defines the modules you want to build and deploy for your IoT Edge solution, and also defines the routes between modules. 默认解决方案自带一个 SimulatedTemperatureSensor 模块和一个 IotEdgeModule1 模块 。The default solution has a SimulatedTemperatureSensor module and a IotEdgeModule1 module. SimulatedTemperatureSensor 模块向 IotEdgeModule1 模块生成模拟数据,而 IotEdgeModule1 模块中的默认代码直接将收到的消息通过管道传输到 Azure IoT 中心 。The SimulatedTemperatureSensor module generates simulated data to the IotEdgeModule1 module, while the default code in the IotEdgeModule1 module directly pipes received messages to Azure IoT Hub.

若要了解模拟温度传感器的工作原理,请查看 SimulatedTemperatureSensor.csproj 源代码To see how the simulated temperature sensor works, view the SimulatedTemperatureSensor.csproj source code.

IotEdgeModule1 项目是一个 .NET Core 2.1 控制台应用程序(如果它是 C# 模块)。The IotEdgeModule1 project is a .NET Core 2.1 console application if it's a C# module. 它包含 IoT Edge 设备通过 Windows 容器或 Linux 容器运行时所需的 Docker 文件。It contains required Docker files you need for your IoT Edge device running with either a Windows container or Linux container. module.json 文件描述模块的元数据。The module.json file describes the metadata of a module. Program.csmain.c 文件中可以找到将 Azure IoT 设备 SDK 用作依赖项的实际模块代码。The actual module code, which takes Azure IoT Device SDK as a dependency, is found in the Program.cs or main.c file.

开发模块Develop your module

解决方案附带的默认模块代码位于 IotEdgeModule1 > Program.cs(适用于 C#)或 main.c (C) 中。The default module code that comes with the solution is located at IotEdgeModule1 > Program.cs (for C#) or main.c (C). 将设置模块和 deployment.template.json 文件,使你能够生成解决方案,将其推送到容器注册表,然后部署到设备以开始测试,而无需修改任何代码。The module and the deployment.template.json file are set up so that you can build the solution, push it to your container registry, and deploy it to a device to start testing without touching any code. 生成该模块是为了从源中获取输入(在本例中为模拟数据的 SimulatedTemperatureSensor 模块)并将其通过管道传输到 Azure IoT 中心。The module is built to take input from a source (in this case, the SimulatedTemperatureSensor module that simulates data) and pipe it to Azure IoT Hub.

准备好使用自己的代码自定义模块模板时,请使用 Azure IoT 中心 SDK 生成模块,以解决 IoT 解决方案的关键需求,例如安全性、设备管理和可靠性。When you're ready to customize the module template with your own code, use the Azure IoT Hub SDKs to build modules that address the key needs for IoT solutions such as security, device management, and reliability.

使用 IoT Edge 设备连接字符串初始化iotegehubdevInitialize iotedgehubdev with IoT Edge device connection string

  1. 从 Visual Studio Cloud Explorer 的“主连接字符串”中复制 IoT Edge 设备的连接字符串 。Copy the connection string of any IoT Edge device from Primary Connection String in the Visual Studio Cloud Explorer. 请勿复制非 Egde 设备的连接字符串,IoT Edge 设备的图标不同于非 Edge 设备的图标。Be sure not to copy the connection string of a non-Edge device, as the icon of an IoT Edge device is different from the icon of a non-Edge device.

    复制 Edge 设备连接字符串

  2. 在“工具”中, 选择“Azure IoT Edge Tools” > “安装 IoT Edge 模拟器” ,粘贴连接字符串,然后单击“确定” 。From the Tools menu, select Azure IoT Edge Tools > Setup IoT Edge Simulator, paste the connection string and click OK.

    打开设置 Edge 连接字符串窗口

  3. 输入第一步中获取的连接字符串,然后选择“确定” 。Enter the connection string from the first step and then select OK.

备注

只需在开发计算机上执行一次这些步骤,所得结果将自动应用于所有后续 Azure IoT Edge 解决方案。You need to follow these steps only once on your development computer as the results are automatically applied to all subsequent Azure IoT Edge solutions. 如果需要更改为另一个连接字符串,可以再次执行此过程。This procedure can be followed again if you need to change to a different connection string.

生成和调试单个模块Build and debug single module

通常,需要先测试和调试每个模块,然后再在具有多个模块的整个解决方案中运行此模块。Typically, you'll want to test and debug each module before running it within an entire solution with multiple modules.

  1. 在“解决方案资源管理器”中右键单击“IotEdgeModule1”,并从上下文菜单中选择“设为启动项目” 。In Solution Explorer, right-click IotEdgeModule1 and select Set as StartUp Project from the context menu.

    设置启动项目

  2. 按 F5 或单击下方的按钮以运行模块,首次运行时可能耗时 10–20 秒。Press F5 or click the button below to run the module; it may take 10–20 seconds the first time you do so.

    运行模块

  3. 如果模块已成功初始化,你应会看到 .NET Core 控制台应用已启动。You should see a .NET Core console app start if the module has been initialized successfully.

    运行中的模块

  4. 如果以 C# 进行开发,请在 Program.cs 中的 PipeMessage() 函数内设置一个断点;如果使用 C,请在 main.c 中的 InputQueue1Callback() 函数内设置断点。If developing in C#, set a breakpoint in the PipeMessage() function in Program.cs; if using C, set a breakpoint in the InputQueue1Callback() function in main.c. 然后,可以通过在 Git BashWSL Bash shell 中运行以下命令发送消息,来测试断点。You can then test it by sending a message by running the following command in a Git Bash or WSL Bash shell. (无法从 PowerShell 或命令提示符运行 curl 命令。)(You cannot run the curl command from a PowerShell or command prompt.)

    curl --header "Content-Type: application/json" --request POST --data '{"inputName": "input1","data":"hello world"}' http://localhost:53000/api/v1/messages
    

    调试单个模块

    应触发断点。The breakpoint should be triggered. 可在 Visual Studio“局部变量”窗口中监视变量 。You can watch variables in the Visual Studio Locals window.

    提示

    还可以使用 PostMan 或其他 API 工具(而非 curl)发送消息。You can also use PostMan or other API tools to send messages instead of curl.

  5. 按 Ctrl + F5 或单击“停止”按钮以停止调试 。Press Ctrl + F5 or click the stop button to stop debugging.

构建并调试具有多个模块的 IoT Edge 解决方案Build and debug IoT Edge solution with multiple modules

开发完单个模块之后,需要运行并调试具有多个模块的整个解决方案。After you're done developing a single module, you might want to run and debug an entire solution with multiple modules.

  1. 在“解决方案资源管理器”中右键单击“AzureIoTEdgeApp1”并选择“添加” > “新 IoT Edge 模块”,向解决方案添加另一个模块。In Solution Explorer, add a second module to the solution by right-clicking AzureIoTEdgeApp1 and selecting Add > New IoT Edge Module. 第二个模块的默认名称为“IotEdgeModule2”,将充当另一个管道模块 。The default name of the second module is IotEdgeModule2 and will act as another pipe module.

  2. 打开文件 deployment.template.json,会看到 IotEdgeModule2 已添加到 modules 节中。Open the file deployment.template.json and you'll see IotEdgeModule2 has been added in the modules section. 将 routes 部分替换为以下内容 。Replace the routes section with the following. 如果自定义了模块名,请确保更新这些名称以匹配模块名。If you have customized your module names, make sure you update these names to match.

        "routes": {
          "IotEdgeModule1ToIoTHub": "FROM /messages/modules/IotEdgeModule1/outputs/* INTO $upstream",
          "sensorToIotEdgeModule1": "FROM /messages/modules/SimulatedTemperatureSensor/outputs/temperatureOutput INTO BrokeredEndpoint(\"/modules/IotEdgeModule1/inputs/input1\")",
          "IotEdgeModule2ToIoTHub": "FROM /messages/modules/IotEdgeModule2/outputs/* INTO $upstream",
          "sensorToIotEdgeModule2": "FROM /messages/modules/SimulatedTemperatureSensor/outputs/temperatureOutput INTO BrokeredEndpoint(\"/modules/IotEdgeModule2/inputs/input1\")"
        },
    
  3. 右键单击“AzureIoTEdgeApp1”并从上下文菜单中选择“设置为启动项目” 。Right-click AzureIoTEdgeApp1 and select Set as StartUp Project from the context menu.

  4. 创建断点,然后按 F5 以同时运行和调试多个模块 。Create your breakpoints and then press F5 to run and debug multiple modules simultaneously. 此时应会看到多个 .NET Core 控制台应用窗口,每个窗口表示一个不同的模块。You should see multiple .NET Core console app windows, which each window representing a different module.

    调试多个模块

  5. 按 Ctrl+F5 或选择“停止”按钮可停止调试 。Press Ctrl + F5 or select the stop button to stop debugging.

生成并推送映像Build and push images

  1. 请确保启动项目是 AzureIoTEdgeApp1 。Make sure AzureIoTEdgeApp1 is the start-up project. 选择“调试”或“发布”作为配置,以生成模块映像 。Select either Debug or Release as the configuration to build for your module images.

    备注

    如果选择“调试”,Visual Studio 使用 Dockerfile.(amd64|windows-amd64).debug 生成 Docker 映像。When choosing Debug, Visual Studio uses Dockerfile.(amd64|windows-amd64).debug to build Docker images. 生成容器映像时,它将在该映像中包含 .NET Core 命令行调试器 VSDBG。This includes the .NET Core command-line debugger VSDBG in your container image while building it. 对于生产就绪的 IoT Edge 模块,建议使用“发布”配置,此模块可在没有 VSDBG 的情况下使用 Dockerfile.(amd64|windows-amd64)For production-ready IoT Edge modules, we recommend that you use the Release configuration, which uses Dockerfile.(amd64|windows-amd64) without VSDBG.

  2. 如果使用的是专用注册表(如 Azure 容器注册表 (ACR)),请使用以下 Docker 命令登录。If you're using a private registry like Azure Container Registry (ACR), use the following Docker command to sign in to it. 可以从 Azure 门户的注册表的“访问密钥”页中获取用户名和密码。 You can get the username and password from the Access keys page of your registry in the Azure portal. 如果使用的是本地注册表,可运行本地注册表If you're using local registry, you can run a local registry.

    docker login -u <ACR username> -p <ACR password> <ACR login server>
    
  3. 如果使用的是专用注册表(如 Azure 容器注册表),则需要将注册表登录信息添加到文件 deployment.template.json 中的运行时设置。If you're using a private registry like Azure Container Registry, you need to add your registry login information to the runtime settings found in the file deployment.template.json. 将占位符替换为实际 ACR 管理员用户名、密码和注册表名。Replace the placeholders with your actual ACR admin username, password, and registry name.

          "settings": {
            "minDockerVersion": "v1.25",
            "loggingOptions": "",
            "registryCredentials": {
              "registry1": {
                "username": "<username>",
                "password": "<password>",
                "address": "<registry name>.azurecr.cn"
              }
            }
          }
    
  4. 在“解决方案资源管理器”中右键单击“AzureIoTEdgeApp1”,选择“构建并推送 IoT Edge 模块”,为每个模块构建并推送 Docker 映像 。 In Solution Explorer, right-click AzureIoTEdgeApp1 and select Build and Push IoT Edge Modules to build and push the Docker image for each module.

部署解决方案Deploy the solution

在用于设置 IoT Edge 设备的快速入门文章中,已使用 Azure 门户部署了一个模块。In the quickstart article that you used to set up your IoT Edge device, you deployed a module by using the Azure portal. 还可使用 Cloud Explorer for Visual Studio 部署模块。You can also deploy modules using the Cloud Explorer for Visual Studio. 为方案和 deployment.json 文件准备好部署清单后,接下来只需要选择一个设备来接收部署即可。You already have a deployment manifest prepared for your scenario, the deployment.json file and all you need to do is select a device to receive the deployment.

  1. 通过单击“视图” > “Cloud Explorer”打开 Cloud Explorer。Open Cloud Explorer by clicking View > Cloud Explorer. 确保已登录到 Visual Studio 2019。Make sure you've logged in to Visual Studio 2019.

  2. 在 Cloud Explorer 中,展开订阅并找到要部署的 Azure IoT 中心和 Azure IoT Edge 设备 。In Cloud Explorer, expand your subscription, find your Azure IoT Hub and the Azure IoT Edge device you want to deploy.

  3. 右键单击 IoT Edge 设备,为其创建部署。Right-click on the IoT Edge device to create a deployment for it. 在 Visual Studio 解决方案的 config 文件夹中,导航到为平台配置的部署清单(如 deployment.arm32v7.json)。Navigate to the deployment manifest configured for your platform located in the config folder in your Visual Studio solution, such as deployment.arm32v7.json.

  4. 单击“刷新”按钮以查看与 SimulatedTemperatureSensor 模块以及 $edgeAgent$edgeHub 一起运行的新模块。Click the refresh button to see the new modules running along with the SimulatedTemperatureSensor module and $edgeAgent and $edgeHub.

查看生成的数据View generated data

  1. 若要监视特定 IoT-Edge 设备的 D2C 消息,请在 Cloud Explorer 的 IoT 中心选择它,然后单击“操作”窗口中的“开始监视内置事件终结点” 。 To monitor the D2C message for a specific IoT-Edge device, select it in your IoT hub in Cloud Explorer and then click Start Monitoring Built-in Event Endpoint in the Action window.

  2. 若要停止监视数据,请选择“操作”窗口中的“停止监视内置事件终结点” 。To stop monitoring data, select Stop Monitoring Built-in Event Endpoint in the Action window.

后续步骤Next steps

若要开发用于 IoT Edge 设备的自定义模块,请参阅了解并使用 Azure IoT 中心 SDKTo develop custom modules for your IoT Edge devices, Understand and use Azure IoT Hub SDKs.