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
description: Use the Azure CLI to deploy Azure IoT Operations extensions to an Arc-enabled Kubernetes cluster.
3
+
description: Use the Azure CLI to deploy Azure IoT Operations to an Arc-enabled Kubernetes cluster.
4
4
author: kgremban
5
5
ms.author: kgremban
6
6
ms.topic: how-to
7
7
ms.custom: ignite-2023, devx-track-azurecli
8
-
ms.date: 06/06/2024
8
+
ms.date: 07/30/2024
9
9
10
10
#CustomerIntent: As an OT professional, I want to deploy Azure IoT Operations to a Kubernetes cluster.
11
11
---
@@ -16,6 +16,17 @@ ms.date: 06/06/2024
16
16
17
17
Deploy Azure IoT Operations Preview to a Kubernetes cluster using the Azure CLI. Once you have Azure IoT Operations deployed, then you can manage and deploy other workloads to your cluster.
18
18
19
+
* An Azure IoT Operations *deployment* describes all of the components and resources that enable the Azure IoT Operations scenario. These components and resources include:
20
+
* An Azure IoT Operations instance
21
+
* Arc extensions
22
+
* Custom locations
23
+
* Resource sync rules
24
+
* Resources that you can configure in your Azure IoT Operations solution, like assets, MQTT broker, and dataflows.
25
+
26
+
* An Azure IoT Operations *instance* is one part of a deployment. It's the parent resource that bundles the suite of services that are defined in [What is Azure IoT Operations Preview?](../overview-iot-operations.md), like MQ, Akri, and OPC UA connector.
27
+
28
+
In this article, when we talk about deploying Azure IoT Operations we mean the full set of components that make up a *deployment*. Once the deployment exists, you can view, manage, and update the *instance*.
29
+
19
30
## Prerequisites
20
31
21
32
Cloud resources:
@@ -24,11 +35,11 @@ Cloud resources:
24
35
25
36
* Azure access permissions. At a minimum, have **Contributor** permissions in your Azure subscription. Depending on the deployment feature flag status you select, you might also need **Microsoft/Authorization/roleAssignments/write** permissions for the resource group that contains your Arc-enabled Kubernetes cluster. You can make a custom role in Azure role-based access control or assign a built-in role that grants this permission. For more information, see [Azure built-in roles for General](../../role-based-access-control/built-in-roles/general.md).
26
37
27
-
If you *don't* have role assignment write permissions, you can still deploy Azure IoT Operations by disabling some features. This approach is discussed in more detail in the [Deploy extensions](#deploy-extensions) section of this article.
38
+
If you *don't* have role assignment write permissions, you can still deploy Azure IoT Operations by disabling some features. This approach is discussed in more detail in the [Deploy](#deploy) section of this article.
28
39
29
40
* In the Azure CLI, use the [az role assignment create](/cli/azure/role/assignment#az-role-assignment-create) command to give permissions. For example, `az role assignment create --assignee sp_name --role "Role Based Access Control Administrator" --scope subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup`
30
41
31
-
* In the Azure portal, you're prompted to restrict access using conditions when you assign privileged admin roles to a user or principal. For this scenario, select the **Allow user to assign all roles** condition in the **Add role assignment** page.
42
+
* In the Azure portal, when you assign privileged admin roles to a user or principal, you can restrict access using conditions. For this scenario, select the **Allow user to assign all roles** condition in the **Add role assignment** page.
32
43
33
44
:::image type="content" source="./media/howto-deploy-iot-operations/add-role-assignment-conditions.png" alt-text="Screenshot that shows assigning users highly privileged role access in the Azure portal.":::
34
45
@@ -40,7 +51,7 @@ Cloud resources:
40
51
41
52
Development resources:
42
53
43
-
* Azure CLI installed on your development machine. For more information, see [How to install the Azure CLI](/cli/azure/install-azure-cli). This scenario requires Azure CLI version 2.46.0 or higher. Use `az --version` to check your version and `az upgrade` to update if necessary.
54
+
* Azure CLI installed on your development machine. For more information, see [How to install the Azure CLI](/cli/azure/install-azure-cli). This scenario requires Azure CLI version 2.53.0 or higher. Use `az --version` to check your version and `az upgrade` to update if necessary.
44
55
45
56
* The Azure IoT Operations extension for Azure CLI. Use the following command to add the extension or update it to the latest version:
46
57
@@ -52,7 +63,7 @@ A cluster host:
52
63
53
64
* An Azure Arc-enabled Kubernetes cluster. If you don't have one, follow the steps in [Prepare your Azure Arc-enabled Kubernetes cluster](./howto-prepare-cluster.md?tabs=wsl-ubuntu).
54
65
55
-
If you've already deployed Azure IoT Operations to your cluster, uninstall those resources before continuing. For more information, see [Update Azure IoT Operations](#update-azure-iot-operations).
66
+
If youdeployed Azure IoT Operations to your cluster previously, uninstall those resources before continuing. For more information, see [Update Azure IoT Operations](#update-azure-iot-operations).
56
67
57
68
Azure IoT Operations should work on any CNCF-conformant kubernetes cluster. Currently, Microsoft only supports K3s on Ubuntu Linux and WSL, or AKS Edge Essentials on Windows. Using Ubuntu in Windows Subsystem for Linux (WSL) is the simplest way to get a Kubernetes cluster for testing.
58
69
@@ -62,13 +73,13 @@ A cluster host:
62
73
az iot ops verify-host
63
74
```
64
75
65
-
## Deploy extensions
76
+
## Deploy
66
77
67
-
Use the Azure CLI to deploy Azure IoT Operations components to your Arc-enabled Kubernetes cluster.
78
+
Use the Azure CLI to deploy Azure IoT Operations to your Arc-enabled Kubernetes cluster.
68
79
69
80
1. Sign in to Azure CLI interactively with a browser even if you already signed in before. If you don't sign in interactively, you might get an error that says *Your device is required to be managed to access your resource* when you continue to the next step to deploy Azure IoT Operations.
70
81
71
-
```azurecli-interactive
82
+
```azurecli
72
83
az login
73
84
```
74
85
@@ -87,65 +98,183 @@ Use the Azure CLI to deploy Azure IoT Operations components to your Arc-enabled
87
98
* Configure a secrets store on your cluster that connects to the key vault.
88
99
* Deploy the Azure IoT Operations resources.
89
100
90
-
```azurecli-interactive
101
+
```azurecli
91
102
az iot ops init --cluster <CLUSTER_NAME> --resource-group <RESOURCE_GROUP> --kv-id <KEYVAULT_SETTINGS_PROPERTIES_RESOURCE_ID>
92
103
```
93
104
94
-
> [!IMPORTANT]
95
-
> By default, the [az iot ops init](/cli/azure/iot/ops#az-iot-ops-init) command doesn't deploy the Data Processor component. To deploy Data Processor, add the `--include-dp` argument.
105
+
If you want to name your Azure IoT Operations instance, include the `--name` parameter. Otherwise, a default name is assigned. You can view the `instanceName` parameter in the command output.
96
106
97
107
If you don't have **Microsoft.Authorization/roleAssignment/write** permissions in the resource group, add the `--disable-rsync-rules` feature flag. This flag disables the resource sync rules on the deployment.
98
108
99
109
If you want to use an existing service principal and app registration instead of allowing `init` to create new ones, include the `--sp-app-id,``--sp-object-id`, and `--sp-secret` parameters. For more information, see [Configure service principal and Key Vault manually](howto-manage-secrets.md#configure-service-principal-and-key-vault-manually).
100
110
101
-
1. After the deployment is complete, you can use [az iot ops check](/cli/azure/iot/ops#az-iot-ops-check) to evaluate IoT Operations service deployment for health, configuration, and usability. The *check* command can help you find problems in your deployment and configuration.
111
+
1. While the deployment is in progress, you can watch the resources being applied to your cluster.
112
+
113
+
* If your terminal supports it, `init` displays the deployment progress.
114
+
115
+
:::image type="content" source="./media/howto-deploy-iot-operations/view-deployment-terminal.png" alt-text="A screenshot that shows the progress of an Azure IoT Operations deployment in a terminal.":::
116
+
117
+
Once the **Deploy IoT Operations** phase begins, the text in the terminal becomes a link to view the deployment progress in the Azure portal.
118
+
119
+
:::image type="content" source="./media/howto-deploy-iot-operations/view-deployment-portal.png" alt-text="A screenshot that shows the progress of an Azure IoT Operations deployment in the Azure portal." lightbox="./media/howto-deploy-iot-operations/view-deployment-portal.png":::
120
+
121
+
* Otherwise, or if you choose to disable the progress interface with `--no-progress`, you can use kubectl commands to view the pods on your cluster:
122
+
123
+
```bash
124
+
kubectl get pods -n azure-iot-operations
125
+
```
126
+
127
+
It can take several minutes for the deployment to complete. Rerun the `get pods`command to refresh your view.
128
+
129
+
1. After the deployment is complete, use [az iot ops check](/cli/azure/iot/ops#az-iot-ops-check) to evaluate IoT Operations service deployment forhealth, configuration, and usability. The *check* command can help you find problemsin your deployment and configuration.
102
130
103
131
```azurecli
104
132
az iot ops check
105
133
```
106
134
107
135
You can also check the configurations of topic maps, QoS, and message routes by adding the `--detail-level 2` parameter for a verbose view.
108
136
109
-
## View resources in your cluster
137
+
## Manage Azure IoT Operations
138
+
139
+
After deployment, you can use the Azure CLI and Azure portal to view and manage your Azure IoT Operations instance.
140
+
141
+
### List instances
142
+
143
+
#### [Azure CLI](#tab/cli)
144
+
145
+
Use the `az iot ops list`command to see all of the Azure IoT Operations instances in your subscription or resource group.
146
+
147
+
The basic command returns all instances in your subscription.
148
+
149
+
```azurecli
150
+
az iot ops list
151
+
```
152
+
153
+
To filter the results by resource group, add the `--resource-group` parameter.
154
+
155
+
```azurecli
156
+
az iot ops list --resource-group <RESOURCE_GROUP>
157
+
```
158
+
159
+
#### [Azure portal](#tab/portal)
160
+
161
+
1. In the [Azure portal](https://portal.azure.com), search for and select**Azure IoT Operations**.
162
+
1. Use the filters to view Azure IoT Operations instances based on subscription, resource group, and more.
163
+
164
+
---
165
+
166
+
### View instance
167
+
168
+
#### [Azure CLI](#tab/cli)
169
+
170
+
Use the `az iot ops show`command to view the properties of an instance.
171
+
172
+
```azurecli
173
+
az iot ops show --name <INSTANCE_NAME> --resource-group <RESOURCE_GROUP>
174
+
```
175
+
176
+
You can also use the `az iot ops show`command to view the resources in your Azure IoT Operations deployment in the Azure CLI. Add the `--tree` flag to show a tree view of the deployment that includes the specified Azure IoT Operations instance.
110
177
111
-
While the deployment is in progress, you can watch the resources being applied to your cluster. You can use kubectl commands to observe changes on the cluster or, since the cluster is Arc-enabled, you can use the Azure portal.
178
+
```azurecli
179
+
az iot ops show --name <INSTANCE_NAME> --resource-group <RESOURCE_GROUP> --tree
180
+
```
112
181
113
-
To view the pods on your cluster, run the following command:
182
+
The tree view of a deployment looks like the following example:
114
183
115
184
```bash
116
-
kubectl get pods -n azure-iot-operations
185
+
MyCluster
186
+
├── extensions
187
+
│ ├── akvsecretsprovider
188
+
│ ├── azure-iot-operations-ltwgs
189
+
│ └── azure-iot-operations-platform-ltwgs
190
+
└── customLocations
191
+
└── MyCluster-cl
192
+
├── resourceSyncRules
193
+
└── resources
194
+
├── MyCluster-ops-init-instance
195
+
└── MyCluster-observability
196
+
```
197
+
198
+
You can run `az iot ops check` on your cluster to assess health and configurations of individual Azure IoT Operations components. By default, the command checks MQ but you can [specify the service](/cli/azure/iot/ops#az-iot-ops-check-examples) with `--ops-service` parameter.
199
+
200
+
#### [Azure portal](#tab/portal)
201
+
202
+
You can view your Azure IoT Operations instance in the Azure portal.
203
+
204
+
1. In the [Azure portal](https://portal.azure.com), go to the resource group that contains your Azure IoT Operations instance, or search for and select**Azure IoT Operations**.
205
+
206
+
1. Select the name of your Azure IoT Operations instance.
207
+
208
+
1. On the **Overview** page of your instance, selectthe**Components** tab to view the resources that were deployed to your cluster.
209
+
210
+
:::image type="content" source="../get-started-end-to-end-sample/media/quickstart-deploy/view-instance.png" alt-text="Screenshot that shows the Azure IoT Operations instance on your Arc-enabled cluster." lightbox="../get-started-end-to-end-sample/media/quickstart-deploy/view-instance.png":::
211
+
212
+
---
213
+
214
+
### Update instance tags and description
215
+
216
+
#### [Azure CLI](#tab/cli)
217
+
218
+
Use the `az iot ops update`command to edit the tags and description parameters of your Azure IoT Operations instance. The values provided in the `update`command replace any existing tags or description
It can take several minutes for the deployment to complete. Rerun the `get pods` command to refresh your view.
224
+
To delete all tags on an instance, setthe tags parameter to a null value. For example:
120
225
121
-
To view your cluster on the Azure portal, use the following steps:
226
+
```azurecli
227
+
az iot ops update --name <INSTANCE_NAME> --resource-group --tags ""
228
+
```
122
229
123
-
. In the [Azure portal](https://portal.azure.com), go to the resource group that contains your Azure IoT Operations instance.
230
+
#### [Azure portal](#tab/portal)
124
231
125
-
1.From the **Overview** page of the resource group, select the name of your Azure IoT Operations instance.
232
+
1. In the [Azure portal](https://portal.azure.com), go to the resource group that contains your Azure IoT Operations instance, or search for and select**Azure IoT Operations**.
126
233
127
-
1.On the **Overview** page of your instance, select the **Components** tab to view the resources that were deployed to your cluster..
234
+
1. Select the name of your Azure IoT Operations instance.
128
235
129
-
:::image type="content" source="../get-started-end-to-end-sample/media/quickstart-deploy/view-components.png" alt-text="Screenshot that shows the deployed components on your Arc-enabled cluster.":::
236
+
1. On the **Overview** page of your instance, select**Add tags** or **edit** to modify tags on your instance.
130
237
131
-
> [!TIP]
132
-
> You can run `az iot ops check` to assess health and configurations of deployed AIO workloads. By default, MQ including cloud connectors are assessed and you can [specifiy the service](/cli/azure/iot/ops#az-iot-ops-check-examples) with `--ops-service --svc`.
238
+
---
133
239
134
240
## Uninstall Azure IoT Operations
135
241
136
-
Use the [az iot ops delete](/cli/azure/iot/ops#az-iot-ops-delete) command to delete or uninstall Azure IoT Operations from a cluster. The `delete` command evaluates the Azure IoT Operations related resources on the cluster and presents a tree view of the resources to be deleted. The cluster should be online prior to running.
242
+
The Azure CLI and Azure portal offer different options for uninstalling Azure IoT Operations.
243
+
244
+
If you want to delete an entire Azure IoT Operations deployment, use the Azure CLI.
245
+
246
+
If you want to delete an Azure IoT Operations instance but keep the related resources in the deployment, use the Azure portal.
247
+
248
+
### [Azure CLI](#tab/cli)
249
+
250
+
Use the [az iot ops delete](/cli/azure/iot/ops#az-iot-ops-delete) command to delete the entire Azure IoT Operations deployment from a cluster. The `delete`command evaluates the Azure IoT Operations related resources on the cluster and presents a tree view of the resources to be deleted. The cluster should be online when you run this command.
137
251
138
252
The `delete`command removes:
139
253
140
-
* Azure IoT Operations extensions
141
-
* Azure IoT Operations resource sync rules
142
-
* Azure IoT Operations resources
143
-
* Associated custom location
254
+
* The Azure IoT Operations instance
255
+
* Arc extensions
256
+
* Custom locations
257
+
* Resource sync rules
258
+
* Resources that you can configure in your Azure IoT Operations solution, like assets, MQTT broker, and dataflows.
144
259
145
260
```azurecli
146
261
az iot ops delete --cluster <CLUSTER_NAME> --resource-group <RESOURCE_GROUP>
147
262
```
148
263
264
+
### [Azure portal](#tab/portal)
265
+
266
+
1. In the [Azure portal](https://portal.azure.com), go to the resource group that contains your Azure IoT Operations instance, or search for and select**Azure IoT Operations**.
267
+
268
+
1. Select the name of your Azure IoT Operations instance.
269
+
270
+
1. On the **Overview** page of your instance, select**Delete** your instance.
271
+
272
+
1. Review the list of resources that are and aren't deleted as part of this operation, then type the name of your instance and select **Delete** to confirm.
273
+
274
+
:::image type="content" source="./media/howto-deploy-iot-operations/delete-instance.png" alt-text="A screenshot that shows deleting an Azure IoT Operations instance in the Azure portal.":::
275
+
276
+
---
277
+
149
278
## Update Azure IoT Operations
150
279
151
280
Currently, there's no support for updating an existing Azure IoT Operations deployment. Instead, uninstall and redeploy a new version of Azure IoT Operations.
0 commit comments