Skip to content

Commit e258e67

Browse files
committed
cli commands contd
1 parent dd5df9f commit e258e67

File tree

4 files changed

+52
-44
lines changed

4 files changed

+52
-44
lines changed

articles/iot-operations/deploy-iot-ops/howto-deploy-iot-operations.md

Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ ms.date: 09/23/2024
1414

1515
[!INCLUDE [public-preview-note](../includes/public-preview-note.md)]
1616

17-
Learn how to deploy Azure IoT Operations Preview to a Kubernetes cluster and then manage that Azure IoT Operations instance using the Azure CLI or Azure portal.
17+
Learn how to deploy Azure IoT Operations Preview to a Kubernetes cluster using the Azure CLI or Azure portal.
18+
19+
In this article, we discuss Azure IoT Operations *deployments* and *instances*, which are two different concepts:
1820

1921
* An Azure IoT Operations *deployment* describes all of the components and resources that enable the Azure IoT Operations scenario. These components and resources include:
2022
* An Azure IoT Operations instance
@@ -23,9 +25,9 @@ Learn how to deploy Azure IoT Operations Preview to a Kubernetes cluster and the
2325
* Resource sync rules
2426
* Resources that you can configure in your Azure IoT Operations solution, like assets and asset endpoints.
2527

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 MQTT broker, dataflows, and OPC UA connector.
28+
* An Azure IoT Operations *instance* is the parent resource that bundles the suite of services that are defined in [What is Azure IoT Operations Preview?](../overview-iot-operations.md) like MQTT broker, dataflows, and OPC UA connector.
2729

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*.
30+
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*.
2931

3032
## Prerequisites
3133

@@ -39,17 +41,17 @@ Cloud resources:
3941
az keyvault create --enable-rbac-authorization --name "<KEYVAULT_NAME>" --resource-group "<RESOURCE_GROUP>"
4042
```
4143

42-
* Azure access permissions:
44+
* Azure access permissions. For more information, see [Steps to assign an Azure role](../../role-based-access-control/role-assignments-steps.md).
4345

4446
* At a minimum, have **Contributor** permissions in your Azure subscription.
4547

46-
* Creating secrets in Key Vault require s**Key Vault Secrets Officer** permissions.
48+
* Creating secrets in Key Vault requires **Key Vault Secrets Officer** permissions.
4749

48-
* The following tasks require **Microsoft/Authorization/roleAssignments/write** permissions. You can make a custom role in Azure role-based access control or assign a [built-in role](../../role-based-access-control/built-in-roles/general.md) that grants this permission.
50+
* The following tasks require **Microsoft/Authorization/roleAssignments/write** permissions.
4951

5052
* Enabling resource sync rules on the Azure IoT Operations instance. If you don't have role assignment write permissions, you can disable this feature during deployment. This approach is discussed in more detail in the [Deploy](#deploy) section of this article.
5153

52-
* Creating a schema registry. If you don't have role assignment write permissions, you can request them or ask that someone with the correct permissions create a schema registry that you can refer to.
54+
* Creating a schema registry.
5355

5456
> [!TIP]
5557
>
@@ -61,7 +63,7 @@ Cloud resources:
6163
6264
Development resources:
6365

64-
* 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.
66+
* Azure CLI installed on your development machine. This scenario requires Azure CLI version 2.64.0 or higher. Use `az --version` to check your version and `az upgrade` to update if necessary. For more information, see [How to install the Azure CLI](/cli/azure/install-azure-cli).
6567

6668
* The Azure IoT Operations extension for Azure CLI. Use the following command to add the extension or update it to the latest version:
6769

@@ -73,11 +75,9 @@ A cluster host:
7375

7476
* An Azure Arc-enabled Kubernetes cluster with the custom location and workload identity features enabled. If you don't have one, follow the steps in [Prepare your Azure Arc-enabled Kubernetes cluster](./howto-prepare-cluster.md?tabs=wsl-ubuntu).
7577

76-
If you deployed Azure IoT Operations to your cluster previously, uninstall those resources before continuing. For more information, see [Update Azure IoT Operations](#update-azure-iot-operations).
77-
78-
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.
78+
If you deployed Azure IoT Operations to your cluster previously, uninstall those resources before continuing. For more information, see [Update Azure IoT Operations](./howto-manage-update-uninstall.md#update).
7979

80-
Use the Azure IoT Operations extension for Azure CLI to verify that your cluster host is configured correctly for deployment by using the [verify-host](/cli/azure/iot/ops#az-iot-ops-verify-host) command on the cluster host:
80+
* Verify that your cluster host is configured correctly for deployment by using the [verify-host](/cli/azure/iot/ops#az-iot-ops-verify-host) command on the cluster host:
8181

8282
```azurecli
8383
az iot ops verify-host
@@ -91,7 +91,7 @@ The Azure portal deployment experience is a helper tool that generates a deploym
9191

9292
### [Azure CLI](#tab/cli)
9393

94-
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.
94+
1. Sign in to Azure CLI interactively with a browser even if you already signed in before.
9595

9696
```azurecli
9797
az login
@@ -109,33 +109,24 @@ The Azure portal deployment experience is a helper tool that generates a deploym
109109

110110
Azure IoT Operations requires a schema registry on your cluster. Schema registry requires an Azure storage account so that it can synchronize schema information between cloud and edge.
111111

112-
Run the following CLI commands in your Codespaces terminal.
113-
114-
1. Set environment variables for the resources you create in this section.
115-
116-
| Placeholder | Value |
117-
| ----------- | ----- |
118-
| <STORAGE_ACCOUNT_NAME> | A name for your storage account. Storage account names must be between 3 and 24 characters in length and only contain numbers and lowercase letters. |
119-
| <SCHEMA_REGISTRY_NAME> | A name for your schema registry. |
120-
| <SCHEMA_REGISTRY_NAMESPACE> | A name for your schema registry namespace. The namespace uniquely identifies a schema registry within a tenant. |
112+
1. Create a storage account with hierarchical namespace enabled.
121113

122114
```azurecli
123-
export STORAGE_ACCOUNT=<STORAGE_ACCOUNT_NAME>
124-
export SCHEMA_REGISTRY=<SCHEMA_REGISTRY_NAME>
125-
export SCHEMA_REGISTRY_NAMESPACE=<SCHEMA_REGISTRY_NAMESPACE>
115+
az storage account create --name <STORAGE_ACCOUNT_NAME> --resource-group <RESOURCE_GROUP> --enable-hierarchical-namespace
126116
```
127117

128-
1. Create a storage account with hierarchical namespace enabled.
118+
1. Create a schema registry that connects to your storage account.
129119

130120
```azurecli
131-
az storage account create --name $STORAGE_ACCOUNT --location $LOCATION --resource-group $RESOURCE_GROUP --enable-hierarchical-namespace
121+
az iot ops schema registry create --name <SCHEMA_REGISTRY> --resource-group <RESOURCE_GROUP> --registry-namespace <SCHEMA_REGISTRY_NAMESPACE> --sa-resource-id $(az storage account show --name <STORAGE_ACCOUNT_NAME> --resource-group <RESOURCE_GROUP> -o tsv --query id)
132122
```
133123

134-
1. Create a schema registry that connects to your storage account. This command also creates a blob container called **schemas** in the storage account if one doesn't exist already.
124+
Use the optional parameters to customize your schema registry, including:
135125

136-
```azurecli
137-
az iot ops schema registry create --name $SCHEMA_REGISTRY --resource-group $RESOURCE_GROUP --registry-namespace $SCHEMA_REGISTRY_NAMESPACE --sa-resource-id $(az storage account show --name $STORAGE_ACCOUNT --resource-group $RESOURCE_GROUP -o tsv --query id)
138-
```
126+
| Optional parameter | Value | Description |
127+
| --------- | ----- | ----------- |
128+
| `--custom-role-id` | Role definitio, ID | The schema registry needs read/write access to the storage account. Provide a custom role ID to use instead of the default **Storage Blob Data Contributor**. Format: `/subscriptions/<SUBSCRIPTION_ID>/providers/Microsoft.Authorization/roleDefinitions/<ROLE_ID>`. |
129+
| `--sa-container` | string | Storage account container where schemas will be stored. If this container doesn't exist, it will be created. The default container name is **schemas**. |
139130

140131
### Deploy Azure IoT Operations
141132

@@ -155,10 +146,10 @@ Run the following CLI commands in your Codespaces terminal.
155146
1. Deploy Azure IoT Operations. This command takes several minutes to complete:
156147

157148
```azurecli
158-
az iot ops create --cluster $CLUSTER_NAME --resource-group $RESOURCE_GROUP
149+
az iot ops create --cluster <CLUSTER_NAME> --resource-group <RESOURCE_GROUP>
159150
```
160151

161-
Use the [optional parameters](/cli/azure/iot/ops#az-iot-ops-init-optional-parameters) to customize your cluster, including:
152+
Use the optional parameters to customize your instance, including:
162153

163154
| Optional parameter | Value | Description |
164155
| --------- | ----- | ----------- |
@@ -190,9 +181,9 @@ Azure secret requires a user-assigned managed identity with access to the Azure
190181

191182
1. Create a user-assigned managed identity that has access to the Azure Key Vault.
192183

193-
```azurecli
194-
az identity create --name "<USER_ASSIGNED_IDENTITY_NAME>" --resource-group "<RESOURCE_GROUP>" --location "<LOCATION>" --subscription "<SUBSCRIPTION>"
195-
```
184+
```azurecli
185+
az identity create --name "<USER_ASSIGNED_IDENTITY_NAME>" --resource-group "<RESOURCE_GROUP>" --location "<LOCATION>" --subscription "<SUBSCRIPTION>"
186+
```
196187

197188
1. Configure the Azure IoT Operations instance for secret synchronization. This command:
198189

@@ -310,15 +301,15 @@ az identity create --name "<USER_ASSIGNED_IDENTITY_NAME>" --resource-group "<RES
310301
311302
While the deployment is in progress, you can watch the resources being applied to your cluster.
312303
313-
* If your terminal supports it, `init` displays the deployment progress.
304+
If your terminal supports it, the `init` and `create` commands display the deployment progress.
314305
315306
:::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.":::
316307
317308
Once the **Deploy IoT Operations** phase begins, the text in the terminal becomes a link to view the deployment progress in the Azure portal.
318309
319310
:::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":::
320311
321-
* Otherwise, or if you choose to disable the progress interface with `--no-progress` added to the `init` command, you can use kubectl commands to view the pods on your cluster:
312+
Otherwise, or if you choose to disable the progress interface with `--no-progress` added to the commands, you can use kubectl commands to view the pods on your cluster:
322313
323314
```bash
324315
kubectl get pods -n azure-iot-operations

articles/iot-operations/deploy-iot-ops/howto-enable-secure-settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The end-to-end sample articles skip the secure settings configuration and instea
2222

2323
* An Azure IoT Operations instance deployed with test settings, as in [Quickstart: Run Azure IoT Operations Preview in GitHub Codespaces](../get-started-end-to-end-sample/quickstart-deploy.md).
2424

25-
* 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.
25+
* Azure CLI installed on your development machine. This scenario requires Azure CLI version 2.64.0 or higher. Use `az --version` to check your version and `az upgrade` to update if necessary. For more information, see [How to install the Azure CLI](/cli/azure/install-azure-cli).
2626

2727
* The Azure IoT Operations extension for Azure CLI. Use the following command to add the extension or update it to the latest version:
2828

articles/iot-operations/deploy-iot-ops/howto-manage-update-uninstall.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ ms.date: 09/23/2024
1616

1717
Use the Azure CLI and Azure portal to manage, uninstall, or update Azure IoT Operations instances.
1818

19+
## Prerequisites
20+
21+
* An Azure IoT Operations instance deployed to a cluster. For more information, see [Deploy Azure IoT Operations](./howto-deploy-iot-operations.md).
22+
23+
* Azure CLI installed on your development machine. This scenario requires Azure CLI version 2.64.0 or higher. Use `az --version` to check your version and `az upgrade` to update if necessary. For more information, see [How to install the Azure CLI](/cli/azure/install-azure-cli).
24+
25+
* The Azure IoT Operations extension for Azure CLI. Use the following command to add the extension or update it to the latest version:
26+
27+
```azurecli
28+
az extension add --upgrade --name azure-iot-ops
29+
```
30+
1931
## Manage
2032

2133
After deployment, you can use the Azure CLI and Azure portal to view and manage your Azure IoT Operations instance.
@@ -123,14 +135,14 @@ az iot ops update --name <INSTANCE_NAME> --resource-group --tags ""
123135

124136
The Azure CLI and Azure portal offer different options for uninstalling Azure IoT Operations.
125137

126-
If you want to delete an entire Azure IoT Operations deployment, use the Azure CLI.
127-
128-
If you want to delete an Azure IoT Operations instance but keep the related resources in the deployment, use the Azure portal.
138+
The Azure portal steps can delete an Azure IoT Operations instance, but can't affect the related resources in the deployment. If you want to delete the entire deployment, use the Azure CLI.
129139

130140
### [Azure CLI](#tab/cli)
131141

132142
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.
133143

144+
The `delete` command streamlines the redeployment of Azure IoT Operations to the same cluster. It undoes the `create` command so that you can run `create`, `delete`, `create` again and so on without having to rerun `init`.
145+
134146
The `delete` command removes:
135147

136148
* The Azure IoT Operations instance
@@ -140,7 +152,12 @@ The `delete` command removes:
140152
* Resources that you can configure in your Azure IoT Operations solution, like assets, MQTT broker, and dataflows.
141153

142154
```azurecli
143-
az iot ops delete --cluster <CLUSTER_NAME> --resource-group <RESOURCE_GROUP>
155+
az iot ops delete --name <INSTANCE_NAME> --resource-group <RESOURCE_GROUP>
156+
```
157+
158+
To delete the instance and also remove the Azure IoT Operations dependencies (the output of `init`), add the flag `--include-deps`.
159+
160+
```az iot ops delete --name <INSTANCE_NAME> --resource-group <RESOURCE_GROUP> --include-deps
144161
```
145162

146163
### [Azure portal](#tab/portal)

articles/iot-operations/overview-iot-operations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ There are two core elements in the Azure IoT Operations Preview architecture:
4242
Azure IoT Operations runs on Arc-enabled Kubernetes clusters on the edge. You can deploy Azure IoT Operations by using the Azure portal or the Azure CLI.
4343

4444
> [!NOTE]
45-
> During public preview, there's no support for upgrading an existing Azure IoT Operations deployment to a newer version. Instead, remove Azure IoT Operations from your cluster and then deploy the latest version. For more information, see [Update Azure IoT Operations](deploy-iot-ops/howto-deploy-iot-operations.md#update-azure-iot-operations).
45+
> During public preview, there's no support for upgrading an existing Azure IoT Operations deployment to a newer version. Instead, remove Azure IoT Operations from your cluster and then deploy the latest version. For more information, see [Update Azure IoT Operations](./deploy-iot-ops/howto-manage-update-uninstall.md#update).
4646
4747
## Manage devices and assets
4848

0 commit comments

Comments
 (0)