你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

使用用于 Visual Studio Code 的 Azure IoT 中心扩展创建 IoT 中心

本文介绍了如何使用用于 Visual Studio Code 的 Azure IoT 中心扩展创建 Azure IoT 中心。

注意

建议使用 Azure Az PowerShell 模块与 Azure 交互。 请参阅安装 Azure PowerShell 以开始使用。 若要了解如何迁移到 Az PowerShell 模块,请参阅 将 Azure PowerShell 从 AzureRM 迁移到 Az

先决条件

创建 IoT 中心

以下步骤介绍如何在 Visual Studio Code (VS Code) 中创建 IoT 中心:

  1. 在 VS Code 中,打开“资源管理器”视图。

  2. 在资源管理器底部,展开“Azure IoT 中心”部分 。

    屏幕截图显示 Visual Studio Code 中的“Azure IoT 中心”部分的位置。

  3. 从“Azure IoT 中心”部分的列表中选择“创建 IoT 中心”。

    屏幕截图显示 Visual Studio Code 中的“创建 IoT 中心”列表项的位置。

  4. 如果未登录到 Azure,右下角会显示一条弹出通知,用于登录 Azure。 选择“登录”,然后按照说明登录到 Azure。

  5. 从 VS Code 顶部的命令面板中,选择 Azure 订阅。

  6. 选择你的资源组。

  7. 选择区域。

  8. 选择定价层。

  9. 输入 IoT 中心的全局唯一名称,然后选择 Enter 键。

  10. 等待几分钟,直到创建好 IoT 中心且“输出”面板中显示确认。

提示

Visual Studio Code 中没有删除 IoT 中心的选项,但你可以在 Azure 门户中删除该中心

后续步骤

使用用于 Visual Studio Code 的 Azure IoT 中心扩展部署 IoT 中心后,请浏览以下文章: