You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Analyze events from Azure Digital Twins setup | Microsoft Docs
3
-
description: Learn how to visualize and analyze events from your Azure Digital Twins spaces, with Azure Time Series Insights, using the steps in this tutorial.
3
+
description: Learn how to visualize and analyze events from your Azure Digital Twins spaces, with Azure Time Series Insights, by using the steps in this tutorial.
4
4
services: digital-twins
5
5
author: dsk-2015
6
6
@@ -10,66 +10,70 @@ ms.date: 10/15/2018
10
10
ms.author: dkshir
11
11
---
12
12
13
-
# Tutorial: Visualize and analyze events from your Azure Digital Twins spaces using Time Series Insights
13
+
# Tutorial: Visualize and analyze events from your Azure Digital Twins spaces by using Time Series Insights
14
14
15
-
Once you have deployed your Azure Digital Twins instance, provisioned your spaces, and implemented custom function to monitor specific conditions, you can then visualize the events and data coming from your spaces to look for trends and anomalies.
15
+
After you deploy your Azure Digital Twins instance, provision your spaces, and implement a custom function to monitor specific conditions, you can visualize the events and data coming from your spaces to look for trends and anomalies.
16
16
17
-
In [the first tutorial](tutorial-facilities-setup.md), you configured the spatial graph of an imaginary building, with a room containing sensors for motion, carbon dioxide, and temperature. In [the second tutorial](tutorial-facilities-udf.md), you provisioned your graph and a user-defined function. The function monitors these sensor values and triggers notifications for the right conditions, that is, the room is empty, and the temperature and carbon dioxide levels are normal. This tutorial shows you how you can integrate the notifications and data coming from your Digital Twins setup with Azure Time Series Insights. You can then visualize your sensor values over time, and look for trends such as, which room is getting the most use, which is the busiest times of the day, and so on. You can also detect anomalies such as, which rooms feel stuffier and hotter, or whether an area in your building is sending consistently high temperature values indicating a faulty air conditioning.
17
+
In [the first tutorial](tutorial-facilities-setup.md), you configured the spatial graph of an imaginary building, with a room that contains sensors for motion, carbon dioxide, and temperature. In [the second tutorial](tutorial-facilities-udf.md), you provisioned your graph and a user-defined function. The function monitors these sensor values and triggers notifications for the right conditions. That is, the room is empty, and the temperature and carbon dioxide levels are normal.
18
+
19
+
This tutorial shows you how you can integrate the notifications and data coming from your Azure Digital Twins setup with Azure Time Series Insights. You can then visualize your sensor values over time. You can look for trends such as which room is getting the most use and which are the busiest times of the day. You can also detect anomalies such as which rooms feel stuffier and hotter, or whether an area in your building is sending consistently high temperature values, indicating faulty air conditioning.
18
20
19
21
In this tutorial, you learn how to:
20
22
21
23
> [!div class="checklist"]
22
-
> * Stream data using Event Hubs
23
-
> * Analyze with Time Series Insights
24
+
> * Stream data by using Azure Event Hubs.
25
+
> * Analyze with Time Series Insights.
24
26
25
27
## Prerequisites
26
28
27
29
This tutorial assumes that you have [configured](tutorial-facilities-setup.md) and [provisioned](tutorial-facilities-udf.md) your Azure Digital Twins setup. Before proceeding, make sure that you have:
28
30
- An [Azure account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
29
31
- An instance of Digital Twins running.
30
32
- The [Digital Twins C# samples](https://github.com/Azure-Samples/digital-twins-samples-csharp) downloaded and extracted on your work machine.
31
-
-[.NET Core SDK version 2.1.403 or above](https://www.microsoft.com/net/download) on your development machine to run the sample. Run `dotnet --version` to verify if the right version is installed.
33
+
-[.NET Core SDK version 2.1.403 or later](https://www.microsoft.com/net/download) on your development machine to run the sample. Run `dotnet --version` to verify that the right version is installed.
32
34
33
35
34
-
## Stream data using Event Hubs
35
-
The [Event Hubs](../event-hubs/event-hubs-about.md) service allows you to create a pipeline to stream your data. This section shows you how to create your event hub as the connector between your Digital Twins and TSI instances.
36
+
## Stream data by using Event Hubs
37
+
You can use the [Event Hubs](../event-hubs/event-hubs-about.md) service to create a pipeline to stream your data. This section shows you how to create your event hub as the connector between your Azure Digital Twins and Time Series Insights instances.
36
38
37
39
### Create an event hub
38
40
39
-
1. Sign in to [Azure portal](https://portal.azure.com).
41
+
1. Sign in to the [Azure portal](https://portal.azure.com).
42
+
43
+
1. In the left pane, select **Create a resource**.
40
44
41
-
1.On the left navigation panel, click **Create a resource**.
45
+
1.Search for and select **Event Hubs**. Select **Create**.
42
46
43
-
1.Search for and select **Event Hubs**. Click**Create**.
47
+
1.Enter a **Name**for your Event Hubs namespace. Choose **Standard** for **Pricing tier**, your **Subscription**, the **Resource group** that you used for your Digital Twins instance, and the **Location**. Select**Create**.
44
48
45
-
1.Enter a **Name** for your Event Hubs namespace, choose *Standard***Pricing tier**, your **Subscription**, the **Resource group** you used for your Digital Twins instance, and the **Location**. Click **Create**.
49
+
1.In the Event Hubs namespace deployment, select the namespace under **RESOURCE**.
46
50
47
-
1. Once deployed, navigate to the Event Hubs namespace *deployment*, and click on the namespace under **RESOURCE**.
51
+

1. Enter a **Name** for your event hub, and select **Create**.
54
58
55
-
1. Enter a **Name** for your event hub, and click **Create**. Once deployed, it will appear in the **Event Hubs** pane of the Event Hubs namespace with an *Active***STATUS**. Click on this event hub to open its **Overview** pane.
59
+
After the event hub is deployed, it appears in the **Event Hubs** pane of the Event Hubs namespace with an **Active** status. Select this event hub to open its **Overview** pane.
56
60
57
-
1.Click **Consumer group** button at the top, and enter a name such as *tsievents* for the consumer group. Click**Create**.
61
+
1.Select the **Consumer group** button at the top, and enter a name such as **tsievents** for the consumer group. Select**Create**.
Once created, the consumer group will appear in the list at the bottom of the event hub's **Overview** pane.
64
+
After the consumer group is created, it appears in the list at the bottom of the event hub's **Overview** pane.
61
65
62
-
1. Open the **Shared access policies** pane for your event hub, and click **Add** button. **Create**a policy named *ManageSend*, and make sure all the checkboxes are checked.
66
+
1. Open the **Shared access policies** pane for your event hub, and select the **Add** button. Enter **ManageSend**as the policy name, make sure all the check boxes are selected, and select **Create**.
1. Open the *ManageSend* policy that you created, and copy the values for **Connection string--primary key** and **Connection string--secondary key** to a temporary file. You will need these values to create an endpoint for the event hub in the next section.
70
+
1. Open the ManageSend policy that you created, and copy the values for **Connection string--primary key** and **Connection string--secondary key** to a temporary file. You'll need these values to create an endpoint for the event hub in the next section.
67
71
68
-
### Create endpoint for the event hub
72
+
### Create an endpoint for the event hub
69
73
70
-
1. In the command window, make sure you are in the **_occupancy-quickstart\src** folder of the Digital Twins sample.
74
+
1. In the command window, make sure you're in the **occupancy-quickstart\src** folder of the Azure Digital Twins sample.
71
75
72
-
1. Open the file **_actions\createEndpoints.yaml_** in your editor. Replace the contents with the following:
76
+
1. Open the file **actions\createEndpoints.yaml** in your editor. Replace the contents with the following:
73
77
74
78
```yaml
75
79
- type: EventHub
@@ -89,20 +93,22 @@ The [Event Hubs](../event-hubs/event-hubs-about.md) service allows you to create
89
93
path: Name_of_your_Event_Hubs_namespace
90
94
```
91
95
92
-
1. Replace the placeholders `Primary_connection_string_for_your_event_hub` with the value of the **Connection string--primary key** for the event hub. Make sure the format of this connection string is as following:
1. Replace the placeholders `Primary_connection_string_for_your_event_hub` with the value of **Connection string--primary key** for the event hub. Make sure the format of this connection string is as follows:
1. Replace the placeholders `Secondary_connection_string_for_your_event_hub` with the value of the **Connection string--secondary key** for the event hub. Make sure the format of this connection string is as following:
1. Replace the placeholders `Secondary_connection_string_for_your_event_hub` with the value of **Connection string--secondary key** for the event hub. Make sure the format of this connection string is as follows:
1. Replace the placeholders `Name_of_your_Event_Hubs_namespace` with the name of your Event Hubs namespace.
103
109
104
110
> [!IMPORTANT]
105
-
> Enter all values without any quotes. Make sure there is at least one space character after the colons in the *YAML* file. You may also validate your *YAML* file contents using any online YAML validator such as [this tool](https://onlineyamltools.com/validate-yaml).
111
+
> Enter all values without any quotes. Make sure there's at least one space character after the colons in the YAML file. You can also validate your YAML file contents by using any online YAML validator, such as [this tool](https://onlineyamltools.com/validate-yaml).
106
112
107
113
108
114
1. Save and close the file. Run the following command in the command window, and sign in with your Azure account when prompted.

117
123
118
124
## Analyze with Time Series Insights
119
125
120
-
1. In the left navigation pane of the [Azure portal](https://portal.azure.com), click **Create a resource**.
126
+
1. In the left pane of the [Azure portal](https://portal.azure.com), select **Create a resource**.
127
+
128
+
1. Search for and select a new **Time Series Insights** resource. Select **Create**.
121
129
122
-
1. Search for and select a new **Time Series Insights** resource. Click **Create**.
130
+
1. Enter a **Name** for your Time Series Insights instance, and then select your **Subscription**. Select the **Resource group** that you used for your Digital Twins instance, and your **Location**. Select **Create**.
123
131
124
-
1. Enter a **Name** for your Time Series Insights instance, and then select your **Subscription**. Select the **Resource group** you used for your Digital Twins instance, and your **Location**. Click **Create**.
132
+

1. After the instance is deployed, open the Time Series Insights environment, and then open its **Event Sources** pane. Select the **Add** button at the top to add a consumer group.
127
135
128
-
1. Once deployed open the Time Series Insights environment, and then open its **Event Sources** pane. Click **Add** button at the top to add a consumer group.
136
+
1. In the **New event source** pane, enter a **Name**, and make sure the other values are selected correctly. Select **ManageSend** for **Event hub policy name**, and then select the consumer group that you created in the previous section for **Event hub consumer group**. Select **Create**.
129
137
130
-
1. In the **New event source** pane, enter a **Name**, and make sure the other values are selected correctly. Select *ManageSend* as the **Event hub policy name**, and then select the *consumer group* you created in the previous section as the **Event hub consumer group**. Click **Create**.
138
+

1. Open the **Overview** pane for your Time Series Insights environment, and select the **Go to Environment** button at the top. If you get a data access warning, open the **Data Access Policies** pane for your Time Series Insights instance, select **Add**, select **Contributor** as the role, and select the appropriate user.
133
141
134
-
1. Open the **Overview** pane for your Time Series Insights environment, and click the **Go to Environment** button at the top. If you get a *data access warning*, then open the **Data Access Policies** pane for your TSI instance, click **Add**, select **Contributor** as the role, and select the appropriate user.
142
+
1. The **Go to Environment** button opens the [Time Series Insights explorer](../time-series-insights/time-series-insights-explorer.md). If it doesn't show any events, simulate device events by browsing to the **device-connectivity** project of your Digital Twins sample, and running `dotnet run`.
135
143
136
-
1. The **Go to Environment** button opens the [Time Series Insights Explorer](../time-series-insights/time-series-insights-explorer.md). If it does not show any events, simulate device events by navigating to the **_device-connectivity_** project of your Digital Twins sample, and running `dotnet run`.
144
+
1. After a few simulated events are generated, go back to the Time Series Insights explorer, and select the refresh button at the top. You should see analytical charts being created for your simulated sensor data.
137
145
138
-
1. After a few simulated events are generated, go back to the Time Series Insights explorer, and click the refresh button at the top. You should see analytical charts getting created for your simulated sensor data.
146
+

1. In the Time Series Insights explorer, you can then generate charts and heatmaps for different events and data from your rooms, sensors, and other resources. On the left side, use the **MEASURE** and **SPLIT BY** drop-down boxes to create your own visualizations.
141
149
142
-
1. In the Time Series Explorer, you can then generate charts and heatmaps for different events and data from your rooms, sensors, and other resources. On the left-hand side, click the drop-down boxes named **MEASURE** and **SPLIT BY** to create your own visualizations. For example, select *Events* as the **MEASURE** and *DigitalTwins-SensorHardwareId* to **SPLIT BY**, to generate a heatmap for each of your sensors, similar to the following image:
150
+
For example, select **Events** for **MEASURE** and **DigitalTwins-SensorHardwareId** for **SPLIT BY**, to generate a heatmap for each of your sensors. The heatmap will be similar to the following image:

145
153
146
154
## Clean up resources
147
155
148
-
If you wish to stop exploring Azure Digital Twins beyond this point, feel free to delete resources created in this tutorial:
156
+
If you want to stop exploring Azure Digital Twins beyond this point, feel free to delete resources created in this tutorial:
149
157
150
-
1. From the left-hand menu in the [Azure portal](http://portal.azure.com), click **All resources**, select your Digital Twins resource group, and **Delete** it.
151
-
2. If you need to, you may proceed to delete the sample applications on your work machine as well.
158
+
1. From the left menu in the [Azure portal](http://portal.azure.com), select **All resources**, select your Digital Twins resource group, and then select **Delete**.
159
+
2. If necessary, delete the sample applications on your work machine.
152
160
153
161
154
162
## Next steps
155
163
156
-
Proceed to the next article to learn more about spatial intelligence graphs and object models in Azure Digital Twins.
164
+
Go to the next article to learn more about spatial intelligence graphs and object models in Azure Digital Twins.
157
165
> [!div class="nextstepaction"]
158
166
> [Understanding Digital Twins object models and spatial intelligence graph](concepts-objectmodel-spatialgraph.md)
0 commit comments