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
+26-18Lines changed: 26 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -161,18 +161,21 @@ Also, take note of the following values to use them later to create a Time Serie
161
161
162
162
## Create a function
163
163
164
-
> [!TIP]
165
-
> It is optional to create a function to visualize twin data in the Time Series Insights explorer.
166
-
167
164
In this section, you'll create an Azure function that will convert twin update events from their original form as JSON Patch documents to JSON objects, containing only updated and added values from your twins.
168
165
169
-
### Step 1: Add a new function
166
+
### Step 1: Create function app
167
+
168
+
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
+
170
+
Save the function app name to use later to configure app setting for the two event hubs.
171
+
172
+
### Step 2: Add a new function
170
173
171
-
Inside your function app project created in the [prerequisites](#prerequisites) section, 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**.
174
+
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**.
172
175
173
176
:::image type="content" source="media/how-to-integrate-time-series-insights/create-event-hub-trigger-function.png" alt-text="Screenshot of Visual Studio to create a new Azure function of type event hub trigger.":::
Publish the project with *ProcessDTUpdatetoTSI.cs* function to a function app in Azure.
192
194
193
-
### Configure twins hub app setting
195
+
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.
194
196
195
-
Use the twins hub **primaryConnectionString** value that you saved earlier to create an app setting in your function app that contains your connection string:
197
+
### Step 5: Security access for the function app
198
+
199
+
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
+
201
+
### Step 6: Configure app setting for the two event hubs
202
+
203
+
Next, you'll configure app settings for twins hub and time series hub.
204
+
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:
196
206
197
207
```azurecli-interactive
198
-
az functionapp config appsettings set --settings "EventHubAppSetting-Twins=<primaryConnectionString-value-from-above>" -g <your-resource-group> -n <your-App-Service-(function-app)-name>
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>
199
209
```
200
210
201
-
### Configure time series hub app setting
202
-
203
-
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:
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:
204
212
205
213
```azurecli-interactive
206
-
az functionapp config appsettings set --settings "EventHubAppSetting-TSI=<primaryConnectionString-from above>" -g <your-resource-group> -n <your-App-Service-(function-app)-name>
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>
207
215
```
208
216
209
217
## Create and connect a Time Series Insights instance
210
218
211
-
You will set up Time Series Insights instance to receive data from your time series hub. For more details about this process, see [*Tutorial: Set up an Azure Time Series Insights Gen2 PAYG environment*](../time-series-insights/tutorial-set-up-environment.md). Follow the steps below to create a time series insights.
219
+
In this section, you'll set up Time Series Insights instance to receive data from your time series hub. For more details about this process, see [*Tutorial: Set up an Azure Time Series Insights Gen2 PAYG environment*](../time-series-insights/tutorial-set-up-environment.md). Follow the steps below to create a time series insights environment.
212
220
213
221
1. In the [Azure portal](https://portal.azure.com), search for *Time Series Insights environments*, and select the **Add** button. Choose the following options to create the time series environment.
214
222
@@ -253,7 +261,7 @@ To begin sending data to Time Series Insights, you'll need to start updating the
253
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*.
**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.
0 commit comments