Skip to content

Commit 16e609f

Browse files
committed
edit pass: digital-twins-tutorials
1 parent edeca2d commit 16e609f

File tree

1 file changed

+38
-34
lines changed

1 file changed

+38
-34
lines changed

articles/digital-twins/tutorial-facilities-analyze.md

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ ms.author: dkshir
1212

1313
# Tutorial: Visualize and analyze events from your Azure Digital Twins spaces by using Time Series Insights
1414

15-
After you deploy your Azure Digital Twins instance, provision your spaces, and implement custom function to monitor specific conditions, you can 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.
1616

1717
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.
1818

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, 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.
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 is 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.
2020

2121
In this tutorial, you learn how to:
2222

@@ -30,17 +30,17 @@ This tutorial assumes that you have [configured](tutorial-facilities-setup.md) a
3030
- An [Azure account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
3131
- An instance of Digital Twins running.
3232
- The [Digital Twins C# samples](https://github.com/Azure-Samples/digital-twins-samples-csharp) downloaded and extracted on your work machine.
33-
- [.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 that 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.
3434

3535

3636
## 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 Digital Twins and Time Series Insights instances.
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.
3838

3939
### Create an event hub
4040

4141
1. Sign in to the [Azure portal](https://portal.azure.com).
4242

43-
1. On the left pane, select **Create a resource**.
43+
1. In the left pane, select **Create a resource**.
4444

4545
1. Search for and select **Event Hubs**. Select **Create**.
4646

@@ -61,7 +61,7 @@ You can use the [Event Hubs](../event-hubs/event-hubs-about.md) service to creat
6161
1. Select the **Consumer group** button at the top, and enter a name such as **tsievents** for the consumer group. Select **Create**.
6262
![Event Hub consumer group](./media/tutorial-facilities-analyze/event-hub-consumer-group.png)
6363

64-
After the consumer group is created, it 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.
6565

6666
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**.
6767

@@ -71,9 +71,9 @@ You can use the [Event Hubs](../event-hubs/event-hubs-about.md) service to creat
7171

7272
### Create an endpoint for the event hub
7373

74-
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.
7575

76-
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:
7777

7878
```yaml
7979
- type: EventHub
@@ -93,20 +93,22 @@ You can use the [Event Hubs](../event-hubs/event-hubs-about.md) service to creat
9393
path: Name_of_your_Event_Hubs_namespace
9494
```
9595
96-
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:
97-
```
98-
Endpoint=sb://nameOfYourEventHubNamespace.servicebus.windows.net/;SharedAccessKeyName=ManageSend;SharedAccessKey=yourShareAccessKey1GUID;EntityPath=nameOfYourEventHub
99-
```
96+
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:
10097

101-
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:
102-
```
103-
Endpoint=sb://nameOfYourEventHubNamespace.servicebus.windows.net/;SharedAccessKeyName=ManageSend;SharedAccessKey=yourShareAccessKey2GUID;EntityPath=nameOfYourEventHub
104-
```
98+
```
99+
Endpoint=sb://nameOfYourEventHubNamespace.servicebus.windows.net/;SharedAccessKeyName=ManageSend;SharedAccessKey=yourShareAccessKey1GUID;EntityPath=nameOfYourEventHub
100+
```
101+
102+
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:
103+
104+
```
105+
Endpoint=sb://nameOfYourEventHubNamespace.servicebus.windows.net/;SharedAccessKeyName=ManageSend;SharedAccessKey=yourShareAccessKey2GUID;EntityPath=nameOfYourEventHub
106+
```
105107
106108
1. Replace the placeholders `Name_of_your_Event_Hubs_namespace` with the name of your Event Hubs namespace.
107109
108110
> [!IMPORTANT]
109-
> 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).
110112
111113
112114
1. Save and close the file. Run the following command in the command window, and sign in with your Azure account when prompted.
@@ -115,44 +117,46 @@ Endpoint=sb://nameOfYourEventHubNamespace.servicebus.windows.net/;SharedAccessKe
115117
dotnet run CreateEndpoints
116118
```
117119
118-
It creates two endpoints for your Event hub.
120+
It creates two endpoints for your event hub.
119121
120122
![Endpoints for Event Hubs](./media/tutorial-facilities-analyze/dotnet-create-endpoints.png)
121123
122124
## Analyze with Time Series Insights
123125
124-
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**.
125129
126-
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**.
127131
128-
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+
![Selections for creating a Time Series Insights instance](./media/tutorial-facilities-analyze/create-tsi.png)
129133
130-
![Create TSI](./media/tutorial-facilities-analyze/create-tsi.png)
134+
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.
131135
132-
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**.
133137
134-
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+
![Selections for creating an event source](./media/tutorial-facilities-analyze/tsi-event-source.png)
135139
136-
![TSI event source](./media/tutorial-facilities-analyze/tsi-event-source.png)
140+
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.
137141
138-
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`.
139143
140-
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.
141145
142-
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+
![Chart in the Time Series Insights explorer](./media/tutorial-facilities-analyze/tsi-explorer.png)
143147
144-
![TSI explorer](./media/tutorial-facilities-analyze/tsi-explorer.png)
148+
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.
145149
146-
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:
147151
148-
![TSI explorer](./media/tutorial-facilities-analyze/tsi-explorer-heatmap.png)
152+
![Heatmap in the Time Series Insights explorer](./media/tutorial-facilities-analyze/tsi-explorer-heatmap.png)
149153
150154
## Clean up resources
151155
152-
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:
153157
154-
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.
155-
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.
156160
157161
158162
## Next steps

0 commit comments

Comments
 (0)