Skip to content

Commit e6a2c66

Browse files
authored
Merge pull request #301613 from dominicbetts/patricka-dataflow-cli
Add CLI to IoT Operations data flows
2 parents 8bedc62 + 5aea22d commit e6a2c66

10 files changed

+2733
-63
lines changed

articles/iot-operations/connect-to-cloud/howto-configure-adlsv2-endpoint.md

Lines changed: 317 additions & 5 deletions
Large diffs are not rendered by default.

articles/iot-operations/connect-to-cloud/howto-configure-adx-endpoint.md

Lines changed: 261 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.author: patricka
66
ms.service: azure-iot-operations
77
ms.subservice: azure-data-flows
88
ms.topic: how-to
9-
ms.date: 04/03/2025
9+
ms.date: 06/12/2025
1010
ai-usage: ai-assisted
1111

1212
#CustomerIntent: As an operator, I want to understand how to configure data flow endpoints for Azure Data Explorer in Azure IoT Operations so that I can send data to Azure Data Explorer.
@@ -63,8 +63,6 @@ If using system-assigned managed identity, in Azure portal, go to your Azure IoT
6363
6464
## Create data flow endpoint for Azure Data Explorer
6565
66-
<!-- TODO: use the data ingest URI for host? -->
67-
6866
# [Operations experience](#tab/portal)
6967
7068
1. In the operations experience, select the **Data flow endpoints** tab.
@@ -84,6 +82,60 @@ If using system-assigned managed identity, in Azure portal, go to your Azure IoT
8482
8583
1. Select **Apply** to provision the endpoint.
8684
85+
# [Azure CLI](#tab/cli)
86+
87+
#### Create or replace
88+
89+
Use the [az iot ops dataflow endpoint create adls](/cli/azure/iot/ops/dataflow/endpoint/create#az-iot-ops-dataflow-endpoint-create-adx) command to create or replace an Azure Data Explorer data flow endpoint.
90+
91+
```azurecli
92+
az iot ops dataflow endpoint create adx --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --host <ClusterName> --database <DatabaseName>
93+
```
94+
95+
The `--host` parameter is the hostname of the Azure Data Explorer cluster in the format `<cluster>.<region>.kusto.windows.net`. The `--database` parameter is the name of the Azure Data Explorer database.
96+
97+
Here's an example command to create or replace an Azure Data Explorer data flow endpoint named adx-endpoint:
98+
99+
```azurecli
100+
az iot ops dataflow endpoint create adx --resource-group myResourceGroup --instance myAioInstance --name adx-endpoint --host myadxcluster.eastus.kusto.windows.net --database mydatabase
101+
```
102+
103+
#### Create or change
104+
105+
Use the [az iot ops dataflow endpoint apply](/cli/azure/iot/ops/dataflow/endpoint#az-iot-ops-dataflow-endpoint-apply) command to create or change an Azure Data Explorer data flow endpoint.
106+
107+
```azurecli
108+
az iot ops dataflow endpoint apply --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --config-file <ConfigFilePathAndName>
109+
```
110+
111+
The `--config-file` parameter is the path and file name of a JSON configuration file containing the resource properties.
112+
113+
In this example, assume a configuration file named `adx-endpoint.json` with the following content stored in the user's home directory:
114+
115+
```json
116+
{
117+
"endpointType": "DataExplorer",
118+
"dataExplorerSettings": {
119+
"authentication": {
120+
"method": "SystemAssignedManagedIdentity",
121+
"systemAssignedManagedIdentitySettings": {}
122+
},
123+
"batching": {
124+
"latencySeconds": 60,
125+
"maxMessages": 100000
126+
},
127+
"host": "https://<cluster>.<region>.kusto.windows.net",
128+
"database": "<DatabaseName>"
129+
}
130+
}
131+
```
132+
133+
Here's an example command to create a new Azure Data Explorer data flow endpoint named adx-endpoint:
134+
135+
```azurecli
136+
az iot ops dataflow endpoint apply --resource-group myResourceGroupName --instance myAioInstanceName --name adx-endpoint --config-file ~/adx-endpoint.json
137+
```
138+
87139
# [Bicep](#tab/bicep)
88140

89141
Create a Bicep `.bicep` file with the following content.
@@ -92,7 +144,7 @@ Create a Bicep `.bicep` file with the following content.
92144
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
93145
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
94146
param endpointName string = '<ENDPOINT_NAME>'
95-
param hostName string = 'https://<CLUSTER>.<region>.kusto.windows.net'
147+
param hostName string = 'https://<cluster>.<region>.kusto.windows.net'
96148
param databaseName string = '<DATABASE_NAME>'
97149
98150
resource aioInstance 'Microsoft.IoTOperations/instances@2024-11-01' existing = {
@@ -141,7 +193,7 @@ metadata:
141193
spec:
142194
endpointType: DataExplorer
143195
dataExplorerSettings:
144-
host: 'https://<CLUSTER>.<region>.kusto.windows.net'
196+
host: 'https://<cluster>.<region>.kusto.windows.net'
145197
database: <DATABASE_NAME>
146198
authentication:
147199
# See available authentication methods section for method types
@@ -176,6 +228,60 @@ Then, configure the data flow endpoint with system-assigned managed identity set
176228

177229
In the operations experience data flow endpoint settings page, select the **Basic** tab then choose **Authentication method** > **System assigned managed identity**.
178230

231+
# [Azure CLI](#tab/cli)
232+
233+
#### Create or replace
234+
235+
Use the [az iot ops dataflow endpoint create adls](/cli/azure/iot/ops/dataflow/endpoint/create#az-iot-ops-dataflow-endpoint-create-adx) command to create or replace an Azure Data Explorer data flow endpoint.
236+
237+
```azurecli
238+
az iot ops dataflow endpoint create adx --auth-type SystemAssignedManagedIdentity --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --host <ClusterName> --database <DatabaseName>
239+
```
240+
241+
The `--host` parameter is the hostname of the Azure Data Explorer cluster in the format `<cluster>.<region>.kusto.windows.net`. The `--database` parameter is the name of the Azure Data Explorer database.
242+
243+
Here's an example command to create or replace an Azure Data Explorer data flow endpoint named adx-endpoint:
244+
245+
```azurecli
246+
az iot ops dataflow endpoint create adx --auth-type SystemAssignedManagedIdentity --resource-group myResourceGroup --instance myAioInstance --name adx-endpoint --host myadxcluster.eastus.kusto.windows.net --database mydatabase
247+
```
248+
249+
#### Create or change
250+
251+
Use the [az iot ops dataflow endpoint apply](/cli/azure/iot/ops/dataflow/endpoint#az-iot-ops-dataflow-endpoint-apply) command to create or change an Azure Data Explorer data flow endpoint.
252+
253+
```azurecli
254+
az iot ops dataflow endpoint apply --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --config-file <ConfigFilePathAndName>
255+
```
256+
257+
The `--config-file` parameter is the path and file name of a JSON configuration file containing the resource properties.
258+
259+
In this example, assume a configuration file named `adx-endpoint.json` with the following content stored in the user's home directory:
260+
261+
```json
262+
{
263+
"endpointType": "DataExplorer",
264+
"dataExplorerSettings": {
265+
"authentication": {
266+
"method": "SystemAssignedManagedIdentity",
267+
"systemAssignedManagedIdentitySettings": {}
268+
},
269+
"batching": {
270+
"latencySeconds": 60,
271+
"maxMessages": 100000
272+
},
273+
"host": "https://<cluster>.<region>.kusto.windows.net",
274+
"database": "<DatabaseName>"
275+
}
276+
}
277+
```
278+
279+
Here's an example command to create a new Azure Data Explorer data flow endpoint named adx-endpoint:
280+
281+
```azurecli
282+
az iot ops dataflow endpoint apply --resource-group myResourceGroupName --instance myAioInstanceName --name adx-endpoint --config-file ~/adx-endpoint.json
283+
```
284+
179285
# [Bicep](#tab/bicep)
180286

181287
```bicep
@@ -205,6 +311,62 @@ If you need to override the system-assigned managed identity audience, you can s
205311

206312
In most cases, you don't need to specify other settings. This configuration creates a managed identity with the default audience `https://api.kusto.windows.net`.
207313

314+
# [Azure CLI](#tab/cli)
315+
316+
#### Create or replace
317+
318+
Use the [az iot ops dataflow endpoint create adls](/cli/azure/iot/ops/dataflow/endpoint/create#az-iot-ops-dataflow-endpoint-create-adx) command to create or replace an Azure Data Explorer data flow endpoint with system-assigned managed identity.
319+
320+
```azurecli
321+
az iot ops dataflow endpoint create adx --auth-type SystemAssignedManagedIdentity --audience https://<cluster>.<region>.kusto.windows.net --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --host <cluster>.<region>.kusto.windows.net --database <DatabaseName>
322+
```
323+
324+
The `--host` parameter is the hostname of the Azure Data Explorer cluster in the format `<cluster>.<region>.kusto.windows.net`. The `--database` parameter is the name of the Azure Data Explorer database. The `--audience` parameter is the audience URL for the managed identity to authenticate against Azure Data Explorer.
325+
326+
Here's an example command to create or replace an Azure Data Explorer data flow endpoint named `adx-endpoint`:
327+
328+
```azurecli
329+
az iot ops dataflow endpoint create adx --auth-type SystemAssignedManagedIdentity --audience https://myadxcluster.eastus.kusto.windows.net --resource-group myResourceGroup --instance myAioInstance --name adx-endpoint --host myadxcluster.eastus.kusto.windows.net --database mydatabase
330+
```
331+
332+
#### Create or change
333+
334+
Use the [az iot ops dataflow endpoint apply](/cli/azure/iot/ops/dataflow/endpoint#az-iot-ops-dataflow-endpoint-apply) command to create or change an Azure Data Explorer data flow endpoint with system-assigned managed identity.
335+
336+
```azurecli
337+
az iot ops dataflow endpoint apply --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --config-file <ConfigFilePathAndName>
338+
```
339+
340+
The `--config-file` parameter is the path and file name of a JSON configuration file containing the resource properties.
341+
342+
In this example, assume a configuration file named `adx-endpoint.json` with the following content stored in the user's home directory:
343+
344+
```json
345+
{
346+
"endpointType": "DataExplorer",
347+
"dataExplorerSettings": {
348+
"authentication": {
349+
"method": "SystemAssignedManagedIdentity",
350+
"systemAssignedManagedIdentitySettings": {
351+
"audience": "https://<cluster>.<region>.kusto.windows.net"
352+
}
353+
},
354+
"batching": {
355+
"latencySeconds": 60,
356+
"maxMessages": 100000
357+
},
358+
"host": "https://<cluster>.<region>.kusto.windows.net",
359+
"database": "<DatabaseName>"
360+
}
361+
}
362+
```
363+
364+
Here's an example command to create a new Azure Data Explorer data flow endpoint named `adx-endpoint`:
365+
366+
```azurecli
367+
az iot ops dataflow endpoint apply --resource-group myResourceGroupName --instance myAioInstanceName --name adx-endpoint --config-file ~/adx-endpoint.json
368+
```
369+
208370
# [Bicep](#tab/bicep)
209371

210372
```bicep
@@ -248,6 +410,64 @@ In the operations experience data flow endpoint settings page, select the **Basi
248410

249411
Enter the user assigned managed identity client ID and tenant ID in the appropriate fields.
250412

413+
# [Azure CLI](#tab/cli)
414+
415+
#### Create or replace
416+
417+
Use the [az iot ops dataflow endpoint create adls](/cli/azure/iot/ops/dataflow/endpoint/create#az-iot-ops-dataflow-endpoint-create-adx) command to create or replace an Azure Data Explorer data flow endpoint with user-assigned managed identity.
418+
419+
```azurecli
420+
az iot ops dataflow endpoint create adx --auth-type UserAssignedManagedIdentity --client-id <ClientId> --tenant-id <TenantId> --scope <Scope> --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --host <cluster>.<region>.kusto.windows.net --database <DatabaseName>
421+
```
422+
423+
The `--host` parameter is the hostname of the Azure Data Explorer cluster in the format `<cluster>.<region>.kusto.windows.net`. The `--database` parameter is the name of the Azure Data Explorer database. The `--auth-type` parameter specifies the authentication method, which is `UserAssignedManagedIdentity` in this case. The `--client-id`, `--tenant-id`, and `--scope` parameters specify the user-assigned managed identity client ID, tenant ID, and scope respectively.
424+
425+
Here's an example command to create or replace an Azure Data Explorer data flow endpoint named `adx-endpoint`:
426+
427+
```azurecli
428+
az iot ops dataflow endpoint create adx --auth-type UserAssignedManagedIdentity --client-id ClientId --tenant-id TenantId --scope https://api.kusto.windows.net/.default --resource-group myResourceGroup --instance myAioInstance --name adx-endpoint --host myadxcluster.eastus.kusto.windows.net --database mydatabase
429+
```
430+
431+
#### Create or change
432+
433+
Use the [az iot ops dataflow endpoint apply](/cli/azure/iot/ops/dataflow/endpoint#az-iot-ops-dataflow-endpoint-apply) command to create or change an Azure Data Explorer data flow endpoint with user-assigned managed identity.
434+
435+
```azurecli
436+
az iot ops dataflow endpoint apply --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --config-file <ConfigFilePathAndName>
437+
```
438+
439+
The `--config-file` parameter is the path and file name of a JSON configuration file containing the resource properties.
440+
441+
In this example, assume a configuration file named `adx-endpoint.json` with the following content stored in the user's home directory:
442+
443+
```json
444+
{
445+
"endpointType": "DataExplorer",
446+
"dataExplorerSettings": {
447+
"authentication": {
448+
"method": "UserAssignedManagedIdentity",
449+
"userAssignedManagedIdentitySettings": {
450+
"clientId": "<ClientId>",
451+
"scope": "<Scope>",
452+
"tenantId": "<TenantId>"
453+
}
454+
},
455+
"batching": {
456+
"latencySeconds": 60,
457+
"maxMessages": 100000
458+
},
459+
"host": "https://<cluster>.<region>.kusto.windows.net",
460+
"database": "<DatabaseName>"
461+
}
462+
}
463+
```
464+
465+
Here's an example command to create a new Azure Data Explorer data flow endpoint named `adx-endpoint`:
466+
467+
```azurecli
468+
az iot ops dataflow endpoint apply --resource-group myResourceGroupName --instance myAioInstanceName --name adx-endpoint --config-file ~/adx-endpoint.json
469+
```
470+
251471
# [Bicep](#tab/bicep)
252472

253473
```bicep
@@ -300,6 +520,42 @@ In the operations experience, select the **Advanced** tab for the data flow endp
300520

301521
:::image type="content" source="media/howto-configure-adx-endpoint/adx-advanced.png" alt-text="Screenshot using operations experience to set Azure Data Explorer advanced settings.":::
302522

523+
# [Azure CLI](#tab/cli)
524+
525+
Use the [az iot ops dataflow endpoint apply](/cli/azure/iot/ops/dataflow/endpoint#az-iot-ops-dataflow-endpoint-apply) command to create or change an Azure Data Explorer data flow endpoint with advanced settings.
526+
527+
```azurecli
528+
az iot ops dataflow endpoint apply --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --config-file <ConfigFilePathAndName>
529+
```
530+
531+
The `--config-file` parameter is the path and file name of a JSON configuration file containing the resource properties.
532+
533+
In this example, assume a configuration file named `adx-endpoint.json` with the following content stored in the user's home directory:
534+
535+
```json
536+
{
537+
"endpointType": "DataExplorer",
538+
"dataExplorerSettings": {
539+
"authentication": {
540+
"method": "SystemAssignedManagedIdentity",
541+
"systemAssignedManagedIdentitySettings": {}
542+
},
543+
"batching": {
544+
"latencySeconds": 100,
545+
"maxMessages": 1000
546+
},
547+
"host": "https://<cluster>.<region>.kusto.windows.net",
548+
"database": "<DatabaseName>"
549+
}
550+
}
551+
```
552+
553+
Here's an example command to create a new Azure Data Explorer data flow endpoint named adx-endpoint:
554+
555+
```azurecli
556+
az iot ops dataflow endpoint apply --resource-group myResourceGroupName --instance myAioInstanceName --name adx-endpoint --config-file ~/adx-endpoint.json
557+
```
558+
303559
# [Bicep](#tab/bicep)
304560

305561
```bicep

0 commit comments

Comments
 (0)