Skip to content

Commit b9300b7

Browse files
authored
Merge pull request #212006 from dominicbetts/dominic-linter-pilot-control
Linter pilot - Control IoT Central QS
2 parents 408ebe1 + db3e63b commit b9300b7

File tree

7 files changed

+80
-113
lines changed

7 files changed

+80
-113
lines changed
-24.1 KB
Loading
-24 KB
Loading
-39.9 KB
Loading
14 KB
Loading

articles/iot-central/core/quick-configure-rules.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
11
---
22
title: Quickstart - Configure rules and actions in Azure IoT Central
3-
description: This quickstart shows you how to configure telemetry-based rules and actions in your IoT Central application.
3+
description: In this quickstart, you learn how to configure telemetry-based rules and actions in your IoT Central application.
44
author: dominicbetts
55
ms.author: dobett
6-
ms.date: 06/10/2022
6+
ms.date: 09/26/2022
77
ms.topic: quickstart
88
ms.service: iot-central
99
services: iot-central
1010
ms.custom: mvc, mode-other
11+
12+
# Customer intent: As a new user of IoT Central, I want to learn how to use rules to notify me when a specific condition is detected on one of my device.
1113
---
1214

1315
# Quickstart: Configure rules and actions for your device in Azure IoT Central
1416

15-
In this quickstart, you create an IoT Central rule that sends an email when someone turns your phone over.
17+
Get started with IoT Central rules. IoT Central rules let you automate actions that occur in response to specific conditions. The example in this quickstart uses accelerometer telemetry from the phone to trigger a rule when the phone is turned over.
18+
19+
In this quickstart, you:
20+
21+
- Create a rule that detects when a telemetry value passes a threshold.
22+
- Configure the rule to notify you by email.
23+
- Use the smartphone app to test the rule.
1624

1725
## Prerequisites
1826

19-
Before you begin, you should complete the previous quickstart [Connect your first device](./quick-deploy-iot-central.md). It shows you how to create an Azure IoT Central application and connect the **IoT Plug and Play** smartphone app to it.
27+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free).
28+
- Complete the first quickstart [Create an Azure IoT Central application](./quick-deploy-iot-central.md).
2029

2130
## Create a telemetry-based rule
2231

@@ -116,10 +125,7 @@ After your testing is complete, disable the rule to stop receiving the notificat
116125

117126
## Next steps
118127

119-
In this quickstart, you learned how to:
120-
121-
* Create a telemetry-based rule
122-
* Add an action
128+
In this quickstart, you learned how to create a telemetry-based rule and add an action to it.
123129

124130
To learn more about integrating your IoT Central application with other services, see:
125131

articles/iot-central/core/quick-deploy-iot-central.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
11
---
22
title: Quickstart - Connect a device to an Azure IoT Central application | Microsoft Docs
3-
description: Quickstart - Connect your first device to a new IoT Central application. This quickstart uses a smartphone app from either the Google Play or Apple app store as an IoT device.
3+
description: In this quickstart, you learn how to connect your first device to a new IoT Central application. This quickstart uses a smartphone app from either the Google Play or Apple app store as an IoT device.
44
author: dominicbetts
55
ms.author: dobett
6-
ms.date: 06/22/2022
6+
ms.date: 09/26/2022
77
ms.topic: quickstart
88
ms.service: iot-central
99
services: iot-central
1010
ms.custom: [mode-other, iot-central-frontdoor, contperf-fy22q4]
11+
12+
# Customer intent: As a new user of IoT Central, I want to learn how to get started with an IoT Central application and an IoT device.
1113
---
1214

1315
# Quickstart - Use your smartphone as a device to send telemetry to an IoT Central application
1416

15-
This quickstart shows you how to create an Azure IoT Central application and connect your first device. To get you started quickly, you install an app on your smartphone to act as the device. The app sends telemetry, reports properties, and responds to commands:
17+
Get started with an Azure IoT Central application and connect your first device. To get you started quickly, you install an app on your smartphone to act as the device. The app sends telemetry, reports properties, and responds to commands:
1618

1719
:::image type="content" source="media/quick-deploy-iot-central/overview.png" alt-text="Overview of quickstart scenario connecting a smartphone app to IoT Central." border="false":::
1820

21+
In this quickstart, you:
22+
23+
- Create an IoT Central application.
24+
- Register a new device in the application.
25+
- Connect a device to the application and view the telemetry it sends.
26+
- Control the device from your application.
27+
1928
## Prerequisites
2029

21-
An active Azure subscription. If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
30+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free).
2231

23-
> [!TIP]
24-
> You should have at least **Contributor** access in your Azure subscription. If you created the subscription yourself, you're automatically an administrator with sufficient access. To learn more, see [What is Azure role-based access control?](../../role-based-access-control/overview.md)
32+
You should have at least **Contributor** access in your Azure subscription. If you created the subscription yourself, you're automatically an administrator with sufficient access. To learn more, see [What is Azure role-based access control?](../../role-based-access-control/overview.md)
2533

26-
An Android or iOS smartphone on which you're able to install a free app from one of the official app stores.
34+
- An Android or iOS smartphone on which you're able to install a free app from one of the official app stores.
2735

2836
## Create an application
2937

@@ -35,6 +43,8 @@ IoT Central provides various industry-focused application templates to help you
3543

3644
:::image type="content" source="media/quick-deploy-iot-central/iot-central-create-new-application.png" alt-text="Build your IoT application page":::
3745

46+
If you're prompted to sign in, use the Microsoft account associated with your Azure subscription.
47+
3848
1. On the **New application** page, make sure that **Custom application** is selected under the **Application template**.
3949

4050
1. Azure IoT Central automatically suggests an **Application name** based on the application template you've selected. Enter your own application name such as *Contoso quickstart app*.
@@ -65,7 +75,7 @@ To register your device:
6575

6676
1. On the **Create a new device** page, accept the defaults, and then select **Create**.
6777

68-
1. In the list of devices, click the device name:
78+
1. In the list of devices, click on the device name:
6979

7080
:::image type="content" source="media/quick-deploy-iot-central/device-name.png" alt-text="A screenshot that shows the highlighted device name that you can select.":::
7181

@@ -96,7 +106,7 @@ To view the telemetry from the smartphone app in IoT Central:
96106

97107
1. In IoT Central, navigate to the **Devices** page.
98108

99-
1. In the list of devices, click on your device name, then select **Overview**:
109+
1. In the list of devices, click on the device name, then select **Overview**:
100110

101111
:::image type="content" source="media/quick-deploy-iot-central/iot-central-telemetry.png" alt-text="Screenshot of the overview page with telemetry plots.":::
102112

@@ -119,7 +129,7 @@ To see the acknowledgment from the smartphone app, select **command history**.
119129

120130
## Next steps
121131

122-
In this quickstart, you created an IoT Central application and connected device that sends telemetry. In this quickstart, you used a smartphone app as the IoT device that connects to IoT Central. Here's the suggested next step to continue learning about IoT Central:
132+
In this quickstart, you created an IoT Central application and connected device that sends telemetry. Then you used a smartphone app as the IoT device that connects to IoT Central. Here's the suggested next step to continue learning about IoT Central:
123133

124134
> [!div class="nextstepaction"]
125135
> [Add a rule to your IoT Central application](./quick-configure-rules.md)
Lines changed: 46 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,70 @@
11
---
22
title: Quickstart - Export data from Azure IoT Central
3-
description: Quickstart - Learn how to use the data export feature in IoT Central to integrate with other cloud services.
3+
description: In this quickstart, you learn how to use the data export feature in IoT Central to integrate with other cloud services.
44
author: dominicbetts
55
ms.author: dobett
6-
ms.date: 02/18/2022
6+
ms.date: 09/26/2022
77
ms.topic: quickstart
88
ms.service: iot-central
99
services: iot-central
1010
ms.custom: mvc, mode-other, devx-track-azurecli
1111
ms.devlang: azurecli
12+
13+
# Customer intent: As a new user of IoT Central, I want to learn how to use the data export feature so that I can integrate my IoT Central application with other backend services.
1214
---
1315

1416
# Quickstart: Export data from an IoT Central application
1517

16-
This quickstart shows you how to continuously export data from your Azure IoT Central application to another cloud service. To get you set up quickly, this quickstart uses [Azure Data Explorer](/azure/data-explorer/data-explorer-overview), a fully managed data analytics service for real-time analysis. Azure Data Explorer lets you store, query, and process the telemetry from devices such as the **IoT Plug and Play** smartphone app.
18+
Get started with IoT Central data export to integrate your IoT Central application with another cloud service such as Azure Data Explorer. Azure Data Explorer lets you store, query, and process the telemetry from devices such as the **IoT Plug and Play** smartphone app.
1719

1820
In this quickstart, you:
1921

20-
- Use the data export feature in IoT Central to export the telemetry sent by the smartphone app to an Azure Data Explorer database.
22+
- Use the data export feature in IoT Central to the telemetry from the smartphone app to an Azure Data Explorer database.
2123
- Use Azure Data Explorer to run queries on the telemetry.
2224

25+
Completing this quickstart incurs a small cost in your Azure account for the Azure Data Explorer instance. The first two devices in your IoT Central application are free.
26+
2327
## Prerequisites
2428

25-
- Before you begin, you should complete the first quickstart [Create an Azure IoT Central application](./quick-deploy-iot-central.md). The second quickstart, [Configure rules and actions for your device](quick-configure-rules.md), is optional.
29+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free).
30+
- Complete the first quickstart [Create an Azure IoT Central application](./quick-deploy-iot-central.md). The second quickstart, [Configure rules and actions for your device](quick-configure-rules.md), is optional.
2631
- You need the IoT Central application *URL prefix* that you chose in the first quickstart [Create an Azure IoT Central application](./quick-deploy-iot-central.md).
2732

2833
[!INCLUDE [azure-cli-prepare-your-environment-no-header](../../../includes/azure-cli-prepare-your-environment-no-header.md)]
2934

3035
## Install Azure services
3136

32-
Before you can export data from your IoT Central application, you need an Azure Data Explorer cluster and database. In this quickstart, you use the bash environment in the [Azure Cloud Shell](https://shell.azure.com) to create and configure them.
37+
Before you can export data from your IoT Central application, you need an Azure Data Explorer cluster and database. In this quickstart, you run a bash script in the [Azure Cloud Shell](https://shell.azure.com) to create and configure them.
3338

34-
Run the following script in the Azure Cloud Shell. Replace the `clustername` value with a unique name for your cluster before you run the script. The cluster name can contain only lowercase letters and numbers. Replace the `centralurlprefix` value with the URL prefix you chose in the first quickstart:
39+
The script completes the following steps:
3540

36-
> [!IMPORTANT]
37-
> The script can take 20 to 30 minutes to run.
41+
- Prompts you to sign in to your Azure subscription so that it can generate a bearer token to authenticate the REST API calls.
42+
- Creates an Azure Data Explorer cluster and database.
43+
- Creates a managed identity for your IoT Central application.
44+
- Configures the managed identity with permission to access the Azure Data Explorer database.
45+
- Adds a table to the database to store the incoming telemetry from IoT Central.
46+
47+
Run the following commands to download the script to your Azure Cloud Shell environment:
3848

3949
```azurecli
40-
# The cluster name can contain only lowercase letters and numbers.
41-
# It must contain from 4 to 22 characters.
42-
clustername="<A unique name for your cluster>"
43-
44-
centralurlprefix="<The URL prefix of your IoT Central application>"
45-
46-
databasename="phonedata"
47-
location="eastus"
48-
resourcegroup="IoTCentralExportData"
49-
50-
az extension add -n kusto
51-
52-
# Create a resource group for the Azure Data Explorer cluster
53-
az group create --location $location \
54-
--name $resourcegroup
55-
56-
# Create the Azure Data Explorer cluster
57-
# This command takes at least 10 minutes to run
58-
az kusto cluster create --cluster-name $clustername \
59-
--sku name="Standard_D11_v2" tier="Standard" \
60-
--enable-streaming-ingest=true \
61-
--enable-auto-stop=true \
62-
--resource-group $resourcegroup --location $location
63-
64-
# Create a database in the cluster
65-
az kusto database create --cluster-name $clustername \
66-
--database-name $databasename \
67-
--read-write-database location=$location soft-delete-period=P365D hot-cache-period=P31D \
68-
--resource-group $resourcegroup
69-
70-
# Create and assign a managed identity to use
71-
# when authenticating from IoT Central.
72-
# This assumes your IoT Central was created in the default
73-
# IOTC resource group.
74-
MI_JSON=$(az iot central app identity assign --name $centralurlprefix \
75-
--resource-group IOTC --system-assigned)
76-
77-
## Assign the managed identity permissions to use the database.
78-
az kusto database-principal-assignment create --cluster-name $clustername \
79-
--database-name $databasename \
80-
--principal-id $(jq -r .principalId <<< $MI_JSON) \
81-
--principal-assignment-name $centralurlprefix \
82-
--resource-group $resourcegroup \
83-
--principal-type App \
84-
--tenant-id $(jq -r .tenantId <<< $MI_JSON) \
85-
--role Admin
86-
87-
echo "Azure Data Explorer URL: $(az kusto cluster show --name $clustername --resource-group $resourcegroup --query uri -o tsv)"
50+
wget https://raw.githubusercontent.com/Azure-Samples/iot-central-docs-samples/main/quickstart-cde/createADX.sh
51+
chmod u+x createADX.sh
8852
```
8953

90-
Make a note of the **Azure Data Explorer URL**. You use this value later in the quickstart.
91-
92-
## Configure the database
93-
94-
To add a table in the database to store the accelerometer data from the **IoT Plug and Play** smartphone app:
95-
96-
1. Use the **Azure Data Explorer URL** from the previous section to navigate to your Azure Data Explorer environment.
97-
98-
1. Expand the cluster node and select the **phonedata** database. The cope of the query window changes to `Scope:yourclustername.eastus/phonedata`.
99-
100-
1. Paste the following Kusto script into the query editor and select **Run**:
101-
102-
```kusto
103-
.create table acceleration (
104-
EnqueuedTime:datetime,
105-
Device:string,
106-
X:real,
107-
Y:real,
108-
Z:real
109-
);
110-
```
111-
112-
The result looks like the following screenshot:
54+
Use the following command to run the script:
11355

114-
:::image type="content" source="media/quick-export-data/azure-data-explorer-create-table.png" alt-text="Screenshot that shows the results of creating the table in Azure Data Explorer.":::
56+
- Replace `CLUSTER_NAME` with a unique name for your Azure Data Explorer cluster. The cluster name can contain only lowercase letters and numbers. The length of the cluster name must be between 4 and 22 characters.
57+
- Replace `CENTRAL_URL_PREFIX` with URL prefix you chose in the first quickstart for your IoT Central application.
58+
- When prompted, follow the instructions to sign in to your account. It's necessary for the script to sign in because it generates a bearer token to authenticate a REST API call.
11559

116-
1. In the Azure Data Explorer, open a new tab and paste in the following Kusto script. The script enables streaming ingress for the **acceleration** table:
60+
```azurecli
61+
./createADX.sh CLUSTER_NAME CENTRAL_URL_PREFIX
62+
```
11763

118-
```kusto
119-
.alter table acceleration policy streamingingestion enable;
120-
```
64+
> [!IMPORTANT]
65+
> This script can take 20 to 30 minutes to run.
12166
122-
Keep the Azure Data Explorer page open in your browser. After you configure the data export in your IoT Central application, you'll run a query to view the accelerometer telemetry stored in the **acceleration** table.
67+
Make a note of the **Azure Data Explorer URL** output by the script. You use this value later in the quickstart.
12368

12469
## Configure data export
12570

@@ -213,13 +158,19 @@ Wait until the export status shows **Healthy**:
213158

214159
## Query exported data
215160

216-
In Azure Data Explorer, open a new tab and paste in the following Kusto query and then select **Run** to plot the accelerometer telemetry:
161+
To query the exported telemetry:
217162

218-
```kusto
219-
['acceleration']
220-
| project EnqueuedTime, Device, X, Y, Z
221-
| render timechart
222-
```
163+
1. Use the **Azure Data Explorer URL** output by the script you ran previously to navigate to your Azure Data Explorer environment.
164+
165+
1. Expand the cluster node and select the **phonedata** database. The scope of the query window changes to `Scope:yourclustername.eastus/phonedata`.
166+
167+
1. In Azure Data Explorer, open a new tab and paste in the following Kusto query and then select **Run** to plot the accelerometer telemetry:
168+
169+
```kusto
170+
['acceleration']
171+
| project EnqueuedTime, Device, X, Y, Z
172+
| render timechart
173+
```
223174

224175
You may need to wait for several minutes to collect enough data. Try holding your phone in different orientations to see the telemetry values change:
225176

@@ -229,10 +180,10 @@ You may need to wait for several minutes to collect enough data. Try holding you
229180

230181
[!INCLUDE [iot-central-clean-up-resources](../../../includes/iot-central-clean-up-resources.md)]
231182

232-
To remove the Azure Data Explorer instance from your subscription and avoid being billed unnecessarily, delete the **IoTCentralExportData** resource group from the [Azure portal](https://portal.azure.com/#blade/HubsExtension/BrowseResourceGroups) or run the following command in the Azure Cloud Shell:
183+
To remove the Azure Data Explorer instance from your subscription and avoid being billed unnecessarily, delete the **IoTCentralExportData-rg** resource group from the [Azure portal](https://portal.azure.com/#blade/HubsExtension/BrowseResourceGroups) or run the following command in the Azure Cloud Shell:
233184

234185
```azurecli
235-
az group delete --name IoTCentralExportData
186+
az group delete --name IoTCentralExportData-rg
236187
```
237188

238189
## Next steps
@@ -242,4 +193,4 @@ In this quickstart, you learned how to continuously export data from IoT Central
242193
Now that you know now to export your data, the suggested next step is to:
243194

244195
> [!div class="nextstepaction"]
245-
> [Build and manage a device template](howto-set-up-template.md).
196+
> [Create and connect a device](tutorial-connect-device.md).

0 commit comments

Comments
 (0)