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
Copy file name to clipboardExpand all lines: articles/digital-twins/how-to-integrate-time-series-insights.md
+21-26Lines changed: 21 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,8 +32,8 @@ You'll need to update twin's information a few times to see that data tracked in
32
32
33
33
> [!TIP]
34
34
> In this article, the changing digital twin values that are viewed in Time Series Insights are updated manually for simplicity. However, if you'd like to complete this article with live simulated data, you can set up an Azure function that updates digital twins based on IoT telemetry events from a simulated device. For instructions, follow [*How to: Ingest IoT Hub data*](how-to-ingest-iot-hub-data.md), including the final steps to run the device simulator and validate that the data flow works.
35
-
36
-
Later, look for another TIP to show you where to start running the device simulator and have your Azure functions update the twins automatically, instead of sending manual digital twin update commands.
35
+
>
36
+
> Later, look for another TIP to show you where to start running the device simulator and have your Azure functions update the twins automatically, instead of sending manual digital twin update commands.
You'll need to set environment variables in your function app from earlier, containing the connection strings for the event hub.
149
-
150
148
Get the [time series hub connection string](../event-hubs/event-hubs-get-connection-string.md), using the authorization rules you created above for the time series hub:
151
149
152
150
```azurecli-interactive
@@ -167,8 +165,6 @@ In this section, you'll create an Azure function that will convert twin update e
167
165
168
166
First, create a new function app project in Visual Studio. For instructions on how to do this, see the [**Create a function app in Visual Studio**](how-to-create-azure-function.md#create-a-function-app-in-visual-studio) section of the *How-to: Set up a function for processing data* article.
169
167
170
-
Save the function app name to use later to configure app setting for the two event hubs.
171
-
172
168
### Step 2: Add a new function
173
169
174
170
Create a new Azure function called *ProcessDTUpdatetoTSI.cs* to update device telemetry events to the Time Series Insights. The function type will be **Event Hub trigger**.
@@ -190,28 +186,30 @@ Save your function code.
190
186
191
187
### Step 4: Publish the function app to Azure
192
188
193
-
Publish the project with *ProcessDTUpdatetoTSI.cs* function to a function app in Azure.
189
+
Publish the project with the *ProcessDTUpdatetoTSI.cs* function to a function app in Azure.
194
190
195
191
For instructions on how to do this, see the section [**Publish the function app to Azure**](how-to-create-azure-function.md#publish-the-function-app-to-azure) of the *How-to: Set up a function for processing data* article.
196
192
193
+
Save the function app name to use later to configure app settings for the two event hubs.
194
+
197
195
### Step 5: Security access for the function app
198
196
199
197
Next, **assign an access role** for the function and **configure the application settings** so that it can access your Azure Digital Twins instance. For instructions on how to do this, see the section [**Set up security access for the function app**](how-to-create-azure-function.md#set-up-security-access-for-the-function-app) of the *How-to: Set up a function for processing data* article.
200
198
201
-
### Step 6: Configure app setting for the two event hubs
199
+
### Step 6: Configure app settings for the two event hubs
202
200
203
-
Next, you'll configure app settings for twins hub and time series hub.
201
+
Next, you'll add environment variables in the function app's settings that allow it to access the twins hub and time series hub.
204
202
205
-
Use the twins hub **primaryConnectionString** value that you saved earlier to create an app setting in your function app that contains your connection string:
203
+
Use the twins hub **primaryConnectionString** value that you saved earlier to create an app setting in your function app that contains the twins hub connection string:
206
204
207
205
```azurecli-interactive
208
-
az functionapp config appsettings set --settings "EventHubAppSetting-Twins=<your-twins-hub-primaryConnectionString-value-from-earlier>" -g <your-resource-group> -n <your-App-Service-(function-app)-name>
206
+
az functionapp config appsettings set --settings "EventHubAppSetting-Twins=<your-twins-hub-primaryConnectionString>" -g <your-resource-group> -n <your-App-Service-(function-app)-name>
209
207
```
210
208
211
-
Use the time series hub **primaryConnectionString** value that you saved earlier to create an app setting in your function app that contains your connection string:
209
+
Use the time series hub **primaryConnectionString** value that you saved earlier to create an app setting in your function app that contains the time series hub connection string:
212
210
213
211
```azurecli-interactive
214
-
az functionapp config appsettings set --settings "EventHubAppSetting-TSI=<your-time-series-hub-primaryConnectionString-value-from-earlier>" -g <your-resource-group> -n <your-App-Service-(function-app)-name>
212
+
az functionapp config appsettings set --settings "EventHubAppSetting-TSI=<your-time-series-hub-primaryConnectionString>" -g <your-resource-group> -n <your-App-Service-(function-app)-name>
215
213
```
216
214
217
215
## Create and connect a Time Series Insights instance
@@ -224,13 +222,10 @@ In this section, you'll set up Time Series Insights instance to receive data fro
224
222
-**Resource group** - Choose your resource group.
225
223
***Environment name** - Specify a name for your time series environment.
226
224
***Location** - Choose a location.
227
-
***Tier** - **Gen2(L1)** pricing tier.
228
-
229
-
*Time series ID*
230
-
231
-
***Property name** - $dtId (Your time series ID can be up to three values that you will use to search for your data in Time Series Insights. For this tutorial, you can use **$dtId**. Read more about selecting an ID value in [*Best practices for choosing a Time Series ID*](../time-series-insights/how-to-select-tsid.md)).
225
+
***Tier** - Choose the **Gen2(L1)** pricing tier.
226
+
***Property name** - Enter **$dtId** (Read more about selecting an ID value in [*Best practices for choosing a Time Series ID*](../time-series-insights/how-to-select-tsid.md)).
232
227
***Storage account name** - Specify a storage account name.
233
-
***Enable Warm store** - Leave this field set to *Yes*.
228
+
***Enable warm store** - Leave this field set to *Yes*.
234
229
235
230
You can leave default values for other properties on this page. Select the **Next : Event Source >** button.
236
231
@@ -241,11 +236,11 @@ In this section, you'll set up Time Series Insights instance to receive data fro
241
236
2. In the *Event Source* tab, choose the following fields:
242
237
243
238
***Create an event source?** - Choose *Yes*.
244
-
***Source type** - Choose *Event Hub*
239
+
***Source type** - Choose *Event Hub*.
245
240
***Name** - Specify a name for your event source.
246
-
***Subscription** - Choose your Azure subscription
241
+
***Subscription** - Choose your Azure subscription.
247
242
***Event Hub namespace** - Choose the namespace that you created earlier in this article.
248
-
***Event Hub name** - Choose the *time series hub* name that you created earlier in this article.
243
+
***Event Hub name** - Choose the **time series hub** name that you created earlier in this article.
249
244
***Event Hub access policy name** - Choose the *time series hub auth rule* that you created earlier in this article.
250
245
***Event Hub consumer group** - Select *New* and specify a name for your event hub consumer group. Then, select *Add*.
251
246
***Property name** - Leave this field blank.
@@ -258,10 +253,10 @@ In this section, you'll set up Time Series Insights instance to receive data fro
258
253
259
254
To begin sending data to Time Series Insights, you'll need to start updating the digital twin properties in Azure Digital Twins with changing data values.
260
255
261
-
Use the following CLI command to update the twin property. If you followed [*How-to: Ingest IoT Hub data*](how-to-ingest-iot-hub-data.md#add-a-model-and-twin) article to create a model and twin, the `twin_id` value will be *thermostat67*.
256
+
Use the following CLI command to update the *Temperature* property on the *thermostat67* twin that you added to your instance in the [Prerequisites](#prerequisites) section.
**Repeat the command at least 4 more times with different temperature values**, to create several data points that can be observed later in the Time Series Insights environment.
@@ -278,7 +273,7 @@ Now, data should be flowing into your Time Series Insights instance, ready to be
278
273
279
274
:::image type="content" source="media/how-to-integrate-time-series-insights/view-environment.png" alt-text="Screenshot of the Azure portal to select the Time Series Insights explorer URL in the overview tab of your Time Series Insights environment." lightbox="media/how-to-integrate-time-series-insights/view-environment.png":::
280
275
281
-
2. In the explorer, you will see the twins in the Azure Digital Twins instance shown on the left. Select the *thermostat67* twin, choose the property *Temperature*, and hit **Add**. Note that the instance has multiple twins in the below screenshot.
276
+
2. In the explorer, you will see the twins in the Azure Digital Twins instance shown on the left. Select the *thermostat67* twin, choose the property *Temperature*, and hit **Add**.
282
277
283
278
:::image type="content" source="media/how-to-integrate-time-series-insights/add-data.png" alt-text="Screenshot of the Time Series Insights explorer to select thermostat67, select the property temperature, and hit add." lightbox="media/how-to-integrate-time-series-insights/add-data.png":::
284
279
@@ -287,7 +282,7 @@ Now, data should be flowing into your Time Series Insights instance, ready to be
287
282
:::image type="content" source="media/how-to-integrate-time-series-insights/initial-data.png" alt-text="Screenshot of the TSI explorer to view the initial temperature data. It is a line of random values between 68 and 85" lightbox="media/how-to-integrate-time-series-insights/initial-data.png":::
288
283
289
284
If you allow a simulation to run for much longer, your visualization will look something like this:
290
-
285
+
291
286
:::image type="content" source="media/how-to-integrate-time-series-insights/day-data.png" alt-text="Screenshot of the TSI explorer where temperature data for each twin is graphed in three parallel lines of different colors." lightbox="media/how-to-integrate-time-series-insights/day-data.png":::
0 commit comments