教程:设置 Azure 时序见解 Gen2 环境Tutorial: Set up an Azure Time Series Insights Gen2 environment

本教程将引导你完成创建 Azure 时序见解第 2 代环境的过程。This tutorial guides you through the process of creating an Azure Time Series Insights Gen2 environment.

在本教程中,你将了解如何执行以下操作:In this tutorial, you learn how to:

  • 创建 Azure 时序见解 Gen2 环境。Create an Azure Time Series Insights Gen2 environment.
  • 将 Azure 时序见解 Gen2 环境连接到 IoT 中心。Connect the Azure Time Series Insights Gen2 environment to an IoT Hub.

注册一个 Azure 订阅(如果还没有)。Sign up for a Azure subscription if you don't already have one.

先决条件Prerequisites

创建 Azure 时序见解 Gen2 环境Create an Azure Time Series Insights Gen2 environment

本部分介绍如何创建 Azure 时序见解 Gen2 环境,并使用 Azure 门户将其连接到由 IoT 解决方案加速器创建的 IoT 中心。This section describes how to create an Azure Time Series Insights Gen2 environment and connect it to the IoT hub created by the IoT Solution Accelerator using the Azure portal.

  1. 使用 Azure 订阅帐户登录到 Azure 门户Sign in to the Azure portal by using your Azure subscription account.

  2. 选择左上角的“+ 创建资源”。Select + Create a resource in the upper left.

  3. 依次选择“物联网”类别、“时序见解” 。Select the Internet of Things category, and then select Time Series Insights.

    选择时序见解环境资源。Select the Time Series Insights environment resource.

  4. 在“创建时序见解环境”窗格的“基本信息”选项卡上,设置以下参数:In the Create Time Series Insights environment pane, on the Basics tab, set the following parameters:

    参数Parameter 操作Action
    环境名称Environment name 输入 Azure 时序见解 Gen2 环境的唯一名称。Enter a unique name for the Azure Time Series Insights Gen2 environment.
    订阅Subscription 输入想要在其中创建 Azure 时序见解 Gen2 环境的订阅。Enter the subscription where you want to create the Azure Time Series Insights Gen2 environment. 最佳做法是使用与设备模拟器创建的其他 IoT 资源相同的订阅。A best practice is to use the same subscription as the rest of the IoT resources that are created by the device simulator.
    资源组Resource group 为 Azure 时序见解 Gen2 环境资源选择现有的资源组或创建新的资源组。Select an existing resource group or create a new resource group for the Azure Time Series Insights Gen2 environment resource. 资源组是 Azure 资源的容器。A resource group is a container for Azure resources. 最佳做法是使用与设备模拟器创建的其他 IoT 资源相同的资源组。A best practice is to use the same resource group as the other IoT resources that are created by the device simulator.
    位置Location 为 Azure 时序见解 Gen2 环境选择数据中心区域。Select a data center region for your Azure Time Series Insights Gen2 environment. 为了避免额外的延迟,最好是在设备模拟器创建的 IoT 中心所在的区域中创建 Azure 时序见解 Gen2 环境。To avoid additional latency, it's best to create your Azure Time Series Insights Gen2 environment in the same region as your IoT hub created by the device simulator.
    Tier 选择 Gen2(L1)。Select Gen2(L1). 这是 Azure 时序见解 Gen2 产品的 SKU。This is the SKU for the Azure Time Series Insights Gen2 product.
    时序 ID 属性名称Time Series ID property name 输入属性名称,需包含唯一标识时序实例的值。Enter a name of a property that contains values that uniquely identify your time series instances. 以后不能更改在“属性名称”框中作为时序 ID 输入的值。The value you enter in the Property name box as Time Series ID cannot be changed later. 在本教程中,请输入 iothub-connection-device-id。若要详细了解包含复合时序 ID 的时序 ID,请阅读选择时序 ID 的最佳做法For this tutorial, enter iothub-connection-device-id. To learn more about Time Series ID including composite Time Series ID, read Best practices for choosing a Time Series ID.
    存储帐户名称Storage account name 为新存储帐户输入全局唯一名称。Enter a globally unique name for a new storage account.
    存储帐户类型Storage account kind 为新的存储帐户选择存储类型。Select the storage kind for a new storage account. 建议选择 StorageV2We recommend StorageV2
    存储帐户复制Storage account replication 为新的存储帐户选择存储类型。Select the storage kind for a new storage account. 根据你的位置选择,你可以选择 LRS、GRS 或 ZRS。Based on your location selection, you can choose from LRS, GRS and ZRS. 对于本教程,你可选择 LRSFor this tutorial, you can select LRS
    分层命名空间Hierarchical namespace 选择 StorageV2 存储类型后,可以选择此选项。This option is selectable, once you select the storage kind to be StorageV2. 默认禁用此项。By default, it is disabled. 对于本教程,你可将其保留为默认禁用状态For this tutorial, you can leave it in its default disabled state
    启用 Warm 存储Enable warm store 选择“是”启用 Warm 存储。Select Yes to enable warm store. 也可在创建环境后禁用和重新启用此设置。This setting can be disabled and re-enabled after the environment has been created as well.
    日志保留期(以天为单位)Data retention (in days) 选择默认选项 7 天。Choose the default option of 7 days.

    新的时序见解环境配置。New Time Series Insights environment configuration.

  5. 在完成时选择“下一步:事件源”Select Next: Event Source.

    配置环境的时序 ID。Configure Time Series ID for the environment.

  6. 在“事件源”选项卡上,设置以下参数:On the Event Source tab, set the following parameters:

    参数Parameter 操作Action
    创建事件源?Create an event source? 请选择“是”。Select Yes.
    名称Name 输入事件源名称的唯一值。Enter a unique value for the event source name.
    源类型Source type 选择“IoT 中心”。Select IoT Hub.
    选择中心Select a hub 选择“选择现有”。Choose Select existing.
    订阅Subscription 选择曾经用于设备模拟器的订阅。Select the subscription that you used for the device simulator.
    IoT 中心名称IoT Hub name 选择为设备模拟器创建的 IoT 中心名称。Select the IoT hub name you created for the device simulator.
    Iot 中心访问策略IoT Hub access policy 选择“iothubowner”。Select iothubowner.
    IoT 中心使用者组IoT Hub consumer group 选择“新建”,输入唯一名称,然后选择“+ 添加” 。Select New, enter a unique name, and then select + Add. 在 Azure 时序见解 Gen2 中,使用者组必须是唯一值。The consumer group must be a unique value in Azure Time Series Insights Gen2.
    时间戳属性Timestamp property 此值用于标识传入遥测数据中的时间戳属性。This value is used to identify the Timestamp property in your incoming telemetry data. 在本教程中,请将此框留空。For this tutorial, leave this box empty. 此模拟器使用 IoT 中心的传入时间戳,Azure 时序见解 Gen2 默认使用该时间戳。This simulator uses the incoming timestamp from IoT Hub, which Azure Time Series Insights Gen2 defaults to.
  7. 选择“查看 + 创建”。Select Review + Create.

    将创建的 IoT 中心配置为事件源。Configure the created IoT hub as an event source.

  8. 选择“创建”。Select Create.

    包含“创建”按钮的“查看 + 创建”页。Review + Create page, with Create button.

    你可以查看部署的状态:You can review the status of your deployment:

    指出部署已完成的通知。Notification that deployment is complete.

  9. 如果你是 Azure 订阅的所有者,则默认情况下可以访问 Azure 时序见解 Gen2 环境。You have access to your Azure Time Series Insights Gen2 environment by default if you are an owner of the Azure subscription. 验证你是否具有访问权限:Verify that you have access:

    1. 搜索资源组,然后选择新创建的 Azure 时序见解 Gen2 环境。Search for your resource group, and then select your newly created Azure Time Series Insights Gen2 environment.

      选择并查看环境。Select and view your environment.

    2. 在“Azure 时序见解 Gen2”页上,选择“数据访问策略”:On the Azure Time Series Insights Gen2 page, select Data Access Policies:

      验证数据访问策略。Verify data access policies.

    3. 验证凭据是否已列出:Verify that your credentials are listed:

      如果未列出你的凭据,则必须通过选择“添加”并搜索自己的凭据来授予自己访问该环境的权限。If your credentials aren't listed, you must grant yourself permission to access the environment by selecting Add and searching for your credentials. 若要详细了解如何设置权限,请参阅授予数据访问权限To learn more about setting permissions, read Grant data access.

清理资源Clean up resources

现在你已完成本教程,请清除已创建的资源:Now that you've completed the tutorial, clean up the resources you created:

  1. Azure 门户的左侧菜单中,选择“所有资源”,找到“Azure 时序见解 Gen2”资源组。From the left menu in the Azure portal, select All resources, locate your Azure Time Series Insights Gen2 resource group.
  2. 通过选择“删除”来删除整个资源组(以及其中包含的所有资源),或者单独删除每个资源。Either delete the entire resource group (and all resources contained within it) by selecting Delete or remove each resource individually.

后续步骤Next steps

在本教程中,你了解了如何执行以下操作:In this tutorial, you learned how to:

  • 创建 Azure 时序见解 Gen2 PAYG 环境。Create an Azure Time Series Insights Gen2 PAYG environment.
  • 将 Azure 时序见解 Gen2 环境连接到 IoT 中心。Connect the Azure Time Series Insights Gen2 environment to an iot hub.

知道如何创建自己的 Azure 时序见解 Gen2 环境后,现在来详细了解 Azure 时序见解 Gen2 的关键概念。Now that you know how to create your own Azure Time Series Insights Gen2 environment, learn more about the key concepts in Azure Time Series Insights Gen2.

了解 Azure 时序见解 Gen2 引入:Read about Azure Time Series Insights Gen2 ingestion:

了解 Azure 时序见解 Gen2 存储:Read about Azure Time Series Insights Gen2 storage:

详细了解时序模型:Learn more about Time Series Models: