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: Enable secure settings on your Azure IoT Operations Preview deployment by configuring an Azure Key Vault and enabling workload identities.
3
+
description: Enable secure settings on your Azure IoT Operations Preview deployment by configuring an Azure key vault and enabling workload identities.
4
4
author: asergaz
5
5
ms.author: sergaz
6
6
ms.topic: how-to
7
7
ms.date: 11/04/2024
8
8
9
-
#CustomerIntent: I deployed Azure IoT Operations with test settings for the quickstart scenario, now I want to enable secure settings to use the full feature set.
9
+
#CustomerIntent: I deployed Azure IoT Operations with test settings for the quickstart scenario, and now I want to enable secure settings to use the full feature set.
10
10
---
11
11
12
-
# Enable secure settings in Azure IoT Operations Preview deployment
12
+
# Enable secure settings in an Azure IoT Operations Preview deployment
The secure settings for Azure IoT Operations include the setup of Secrets Management and user-assigned managed identity for cloud connections, for example, an OPC UA server, or dataflow endpoints.
16
+
The secure settings for Azure IoT Operations include the setup of secrets management and a user-assigned managed identity for cloud connections; for example, an OPC UA server or dataflow endpoints.
17
17
18
18
This article provides instructions for enabling secure settings if you didn't do so during your initial deployment.
19
19
20
20
## Prerequisites
21
21
22
-
* An Azure IoT Operations instance deployed with test settings. For example, if you followed the instructions in [Quickstart: Run Azure IoT Operations in Codespaces](../get-started-end-to-end-sample/quickstart-deploy.md).
22
+
* An Azure IoT Operations instance deployed with test settings. For example, follow the instructions in [Quickstart: Run Azure IoT Operations Preview in GitHub Codespaces](../get-started-end-to-end-sample/quickstart-deploy.md).
23
23
24
-
* 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
+
* Azure CLI installed on your development machine. This scenario requires Azure CLI version 2.64.0 or later. 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).
25
25
26
-
* The latest versions of the following extensions for Azure CLI:
26
+
* The latest versions of the following extensions for the Azure CLI:
27
27
28
28
```azurecli
29
29
az extension add --upgrade --name azure-iot-ops
30
30
az extension add --upgrade --name connectedk8s
31
31
```
32
32
33
-
## Configure cluster for workload identity
33
+
## Configure a cluster for a workload identity
34
34
35
-
A workload identity is an identity you assign to a software workload (such as an application, service, script, or container) to authenticate and access other services and resources. The workload identity feature needs to be enabled on your cluster, so that the [Azure Key Vault Secret Store extension for Kubernetes](/azure/azure-arc/kubernetes/secret-store-extension) and Azure IoT Operations can access Microsoft Entra ID protected resources. To learn more, see [What are workload identities?](/entra/workload-id/workload-identities-overview).
35
+
A *workload identity* is an identity that you assign to a software workload (such as an application, service, script, or container) to authenticate and access other services and resources. The workload identity feature needs to be enabled on your cluster, so that the [Azure Key Vault Secret Store extension for Kubernetes](/azure/azure-arc/kubernetes/secret-store-extension) and Azure IoT Operations can access Microsoft Entra ID protected resources. To learn more, see [What are workload identities?](/entra/workload-id/workload-identities-overview).
36
36
37
37
> [!NOTE]
38
-
> This step only applies to Ubuntu + K3s clusters. The quickstart script for Azure Kubernetes Service (AKS) Edge Essentials used in [Prepare your Azure Arc-enabled Kubernetes cluster](../deploy-iot-ops/howto-prepare-cluster.md) enables workload identity by default. If you have an AKS Edge Essentials cluster, continue to the next section.
38
+
> This step applies only to Ubuntu + K3s clusters. The quickstart script for Azure Kubernetes Service (AKS) Edge Essentials used in [Prepare your Azure Arc-enabled Kubernetes cluster](../deploy-iot-ops/howto-prepare-cluster.md) enables a workload identity by default. If you have an AKS Edge Essentials cluster, continue to the next section.
39
39
40
-
If you aren't sure whether your K3s cluster already has workload identity enabled or not, run the [az connectedk8s show](/cli/azure/connectedk8s#az-connectedk8s-show) command to check:
40
+
If you aren't sure whether or not your K3s cluster already has workload identity enabled, run the [az connectedk8s show](/cli/azure/connectedk8s#az-connectedk8s-show) command to check:
41
41
42
42
```azurecli
43
43
az connectedk8s show --name <CLUSTER_NAME> --resource-group <RESOURCE_GROUP> --query "{oidcIssuerEnabled:oidcIssuerProfile.enabled, workloadIdentityEnabled: securityProfile.workloadIdentity.enabled}"
44
44
```
45
45
46
-
If not already set up, use the following steps to enable workload identity on an existing connected K3s cluster:
46
+
To enable a workload identity on an existing connected K3s cluster:
47
47
48
-
1. Use the [az connectedk8s update](/cli/azure/connectedk8s#az-connectedk8s-update) command to enable the workload identity feature on the cluster.
48
+
1. Use the [az connectedk8s update](/cli/azure/connectedk8s#az-connectedk8s-update) command to enable the workload identity feature on the cluster:
49
49
50
50
```azurecli
51
51
#!/bin/bash
@@ -54,13 +54,13 @@ If not already set up, use the following steps to enable workload identity on an
54
54
RESOURCE_GROUP="<RESOURCE_GROUP>"
55
55
CLUSTER_NAME="<CLUSTER_NAME>"
56
56
57
-
# Enable workload identity
57
+
# Enable a workload identity
58
58
az connectedk8s update --resource-group $RESOURCE_GROUP \
59
59
--name $CLUSTER_NAME \
60
60
--enable-oidc-issuer --enable-workload-identity
61
61
```
62
62
63
-
1. Use the [az connectedk8s show](/cli/azure/connectedk8s#az-connectedk8s-show) command to get the cluster's issuer url. Take a note to add it later in K3s config file.
63
+
1. Use the [az connectedk8s show](/cli/azure/connectedk8s#az-connectedk8s-show) command to get the cluster's issuer URL. You'll add the URL later in the K3s configuration file.
64
64
65
65
```azurecli
66
66
#!/bin/bash
@@ -69,12 +69,12 @@ If not already set up, use the following steps to enable workload identity on an
@@ -88,30 +88,30 @@ If not already set up, use the following steps to enable workload identity on an
88
88
- service-account-max-token-expiration=24h
89
89
```
90
90
91
-
1. Save and exit the file editor.
91
+
1. Save and close the file editor.
92
92
93
-
1. Restart k3s.
93
+
1. Restart k3s:
94
94
95
95
```bash
96
96
systemctl restart k3s
97
97
```
98
98
99
-
## Set up Secrets Management
99
+
## Set up secrets management
100
100
101
-
Secrets Management for Azure IoT Operations uses Secret Store extension to sync the secrets from an Azure Key Vault and store them on the edge as Kubernetes secrets. Secret Store extension requires a userassigned managed identity with access to the Azure Key Vault where secrets are stored. To learn more, see [What are managed identities for Azure resources?](/entra/identity/managed-identities-azure-resources/overview).
101
+
Secrets management for Azure IoT Operations uses the Secret Store extension to sync the secrets from an Azure key vault and store them on the edge as Kubernetes secrets. The Secret Store extension requires a user-assigned managed identity with access to the Azure key vault where secrets are stored. To learn more, see [What are managed identities for Azure resources?](/entra/identity/managed-identities-azure-resources/overview).
102
102
103
-
Follow these steps to set up Secrets Management:
103
+
To set up secrets management:
104
104
105
-
1.[Create an Azure Key Vault](/azure/key-vault/secrets/quick-create-cli#create-a-key-vault) that is used to store secrets, and [give your user account permissions to manage secrets](/azure/key-vault/secrets/quick-create-cli#give-your-user-account-permissions-to-manage-secrets-in-key-vault) with the `Key Vaults Secrets Officer` role.
106
-
1.[Create a user-assigned managed identity](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities?pivots=identity-mi-methods-azp#create-a-user-assigned-managed-identity) for Secret Store extension.
105
+
1.[Create an Azure key vault](/azure/key-vault/secrets/quick-create-cli#create-a-key-vault) that's used to store secrets, and [give your user account permissions to manage secrets](/azure/key-vault/secrets/quick-create-cli#give-your-user-account-permissions-to-manage-secrets-in-key-vault) with the `Key Vaults Secrets Officer` role.
106
+
1.[Create a user-assigned managed identity](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities?pivots=identity-mi-methods-azp#create-a-user-assigned-managed-identity) for the Secret Store extension.
107
107
1. Use the [az iot ops secretsync enable](/cli/azure/iot/ops/secretsync#az-iot-ops-secretsync-enable) command to set up the Azure IoT Operations instance for secret synchronization. This command:
108
108
109
-
- Creates a federated identity credential using the user-assigned managed identity.
110
-
- Adds a role assignment to the user-assigned managed identity for access to the Azure Key Vault.
109
+
- Creates a federated identity credential by using the user-assigned managed identity.
110
+
- Adds a role assignment to the user-assigned managed identity for access to the Azure key vault.
111
111
- Adds a minimum secret provider class associated with the Azure IoT Operations instance.
112
112
113
113
# [Bash](#tab/bash)
114
-
114
+
115
115
```azurecli
116
116
# Variable block
117
117
INSTANCE_NAME="<INSTANCE_NAME>"
@@ -131,9 +131,9 @@ Follow these steps to set up Secrets Management:
Now that secret synchronization setup is complete, you can refer to [Manage Secrets](./howto-manage-secrets.md) to learn how to use secrets with Azure IoT Operations.
159
+
Now that secret synchronization setup is complete, you can refer to [Manage secrets for your Azure IoT Operations Preview deployment](./howto-manage-secrets.md) to learn how to use secrets with Azure IoT Operations.
160
160
161
-
## Set up user-assigned managed identity for cloud connections
161
+
## Set up a user-assigned managed identity for cloud connections
162
162
163
-
Some Azure IoT Operations components like dataflow endpoints use user-assigned managed identity for cloud connections. It's recommended to use a separate identity from the one used to set up Secrets Management.
163
+
Some Azure IoT Operations components, like dataflow endpoints, use a user-assigned managed identity for cloud connections. We recommend that you use a separate identity from the one that you used to set up secrets management.
164
164
165
-
1. [Create a user-assigned managed identity](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities?pivots=identity-mi-methods-azp#create-a-user-assigned-managed-identity) which is used for cloud connections.
165
+
1. [Create a user-assigned managed identity](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities?pivots=identity-mi-methods-azp#create-a-user-assigned-managed-identity) that's used for cloud connections.
166
166
167
167
> [!NOTE]
168
-
> You will need to grant the identity permission to whichever cloud resource this will be used for.
168
+
> You'll need to grant the identity permission to whichever cloud resource you'll use the managed identity for.
169
169
170
-
1. Use the [az iot ops identity assign](/cli/azure/iot/ops) command to assign the identity to the Azure IoT Operations instance. This command also creates a federated identity credential using the OIDC issuer of the indicated connected cluster and the Azure IoT Operations service account.
170
+
1. Use the [az iot ops identity assign](/cli/azure/iot/ops) command to assign the identity to the Azure IoT Operations instance. This command also creates a federated identity credential by using the OIDC issuer of the indicated connected cluster and the Azure IoT Operations service account.
171
171
172
172
# [Bash](#tab/bash)
173
-
173
+
174
174
```azurecli
175
175
# Variable block
176
176
INSTANCE_NAME="<INSTANCE_NAME>"
@@ -185,9 +185,9 @@ Some Azure IoT Operations components like dataflow endpoints use user-assigned m
185
185
--resource-group $RESOURCE_GROUP \
186
186
--mi-user-assigned $USER_ASSIGNED_MI_RESOURCE_ID
187
187
```
188
-
188
+
189
189
# [PowerShell](#tab/powershell)
190
-
190
+
191
191
```azurecli
192
192
# Variable block
193
193
$INSTANCE_NAME="<INSTANCE_NAME>"
@@ -198,12 +198,12 @@ Some Azure IoT Operations components like dataflow endpoints use user-assigned m
198
198
$USER_ASSIGNED_MI_RESOURCE_ID=$(az identity show --name $USER_ASSIGNED_MI_NAME --resource-group $RESOURCE_GROUP --query id --output tsv)
199
199
200
200
201
-
#Assign the identity to the Azure IoT Operations instance
201
+
#Assign the identity to the Azure IoT Operations instance
202
202
az iot ops identity assign --name $INSTANCE_NAME `
203
203
--resource-group $RESOURCE_GROUP `
204
204
--mi-user-assigned $USER_ASSIGNED_MI_RESOURCE_ID
205
205
```
206
-
206
+
207
207
---
208
208
209
-
Now, you can use this managed identity in dataflow endpoints for cloud connections.
209
+
Now you can use this managed identity in dataflow endpoints for cloud connections.
> Azure IoT Operations Preview – enabled by Azure Arc is currently in **preview**. You shouldn't use this preview software in production environments.
11
+
> Azure IoT Operations Preview – enabled by Azure Arc is currently in *preview*. You shouldn't use this preview software in production environments.
12
12
>
13
-
> You'll need to deploy a new Azure IoT Operations installation when a generally available release is made available. You won't be able to upgrade a preview installation.
13
+
> You'll need to deploy a new Azure IoT Operations installation when a generally available release becomes available. You won't be able to upgrade a preview installation.
14
14
>
15
-
> See the [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/) for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.
15
+
> For legalterms that apply to Azure features that are in beta, in preview, or otherwise not yet released into general availability, see the [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
0 commit comments