Skip to content

Commit 4adf690

Browse files
Merge pull request #288693 from asergaz/sergaz-aio-m3
formatting cli commands
2 parents f79719f + 3541caf commit 4adf690

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

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

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ If you aren't sure whether your K3s cluster already has workload identity enable
4242
```azurecli
4343
az connectedk8s show --name <CLUSTER_NAME> --resource-group <RESOURCE_GROUP> --query "{oidcIssuerEnabled:oidcIssuerProfile.enabled, workloadIdentityEnabled: securityProfile.workloadIdentity.enabled}"
4444
```
45-
> [!NOTE]
46-
>You can skip this section if workload identity is already set up.
4745

48-
Use the following steps to enable workload identity on an existing connected K3s cluster:
46+
If not already set up, use the following steps to enable workload identity on an existing connected K3s cluster:
4947

5048
1. Use the [az connectedk8s update](/cli/azure/connectedk8s#az-connectedk8s-update) command to enable the workload identity feature on the cluster.
5149

@@ -57,7 +55,9 @@ Use the following steps to enable workload identity on an existing connected K3s
5755
CLUSTER_NAME="<CLUSTER_NAME>"
5856
5957
# Enable workload identity
60-
az connectedk8s update --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME --enable-oidc-issuer --enable-workload-identity
58+
az connectedk8s update --resource-group $RESOURCE_GROUP \
59+
--name $CLUSTER_NAME \
60+
--enable-oidc-issuer --enable-workload-identity
6161
```
6262

6363
1. Use the [az connectedk8s show](/cli/azure/connectedk8s#az-connectedk8s-show) command to to get the cluster's issuer url. Take a note to add it later in K3s config file.
@@ -117,7 +117,10 @@ If you already have an Azure Key Vault with `Key Vault Secrets Officer` permissi
117117
LOCATION="<LOCATION>"
118118
119119
# Create the Key Vault
120-
az keyvault create --name $KEYVAULT_NAME --resource-group $RESOURCE_GROUP --location $LOCATION --enable-rbac-authorization
120+
az keyvault create --name $KEYVAULT_NAME \
121+
--resource-group $RESOURCE_GROUP \
122+
--location $LOCATION \
123+
--enable-rbac-authorization
121124
```
122125
123126
# [PowerShell](#tab/powershell)
@@ -151,7 +154,9 @@ If you already have an Azure Key Vault with `Key Vault Secrets Officer` permissi
151154
ASSIGNEE_ID=$(az ad signed-in-user show --query id -o tsv)
152155
153156
# Assign the "Key Vault Secrets Officer" role
154-
az role assignment create --role "Key Vault Secrets Officer" --assignee $ASSIGNEE_ID --scope /subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCE_GROUP/providers/Microsoft.KeyVault/vaults/$KEYVAULT_NAME
157+
az role assignment create --role "Key Vault Secrets Officer" \
158+
--assignee $ASSIGNEE_ID \
159+
--scope /subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCE_GROUP/providers/Microsoft.KeyVault/vaults/$KEYVAULT_NAME
155160
```
156161
157162
# [PowerShell](#tab/powershell)
@@ -186,7 +191,9 @@ RESOURCE_GROUP="<RESOURCE_GROUP>"
186191
LOCATION="LOCATION"
187192
188193
# Create the identity
189-
az identity create --name $USER_ASSIGNED_MI_NAME --resource-group $RESOURCE_GROUP --location $LOCATION
194+
az identity create --name $USER_ASSIGNED_MI_NAME \
195+
--resource-group $RESOURCE_GROUP \
196+
--location $LOCATION
190197
```
191198

192199
# [PowerShell](#tab/powershell)
@@ -229,7 +236,10 @@ USER_ASSIGNED_MI_RESOURCE_ID=$(az identity show --name $USER_ASSIGNED_MI_NAME --
229236
KEYVAULT_RESOURCE_ID=$(az keyvault show --name $KEYVAULT_NAME --resource-group $RESOURCE_GROUP --query id --output tsv)
230237
231238
#Enable secret synchronization
232-
az iot ops secretsync enable --name $INSTANCE_NAME --resource-group $RESOURCE_GROUP --mi-user-assigned $USER_ASSIGNED_MI_RESOURCE_ID --kv-resource-id $KEYVAULT_RESOURCE_ID
239+
az iot ops secretsync enable --name $INSTANCE_NAME \
240+
--resource-group $RESOURCE_GROUP \
241+
--mi-user-assigned $USER_ASSIGNED_MI_RESOURCE_ID \
242+
--kv-resource-id $KEYVAULT_RESOURCE_ID
233243
```
234244

235245
# [PowerShell](#tab/powershell)
@@ -273,7 +283,9 @@ Some Azure IoT Operations components like dataflow endpoints use user-assigned m
273283
LOCATION="LOCATION"
274284
275285
# Create the identity
276-
az identity create --name $USER_ASSIGNED_MI_NAME --resource-group $RESOURCE_GROUP --location $LOCATION
286+
az identity create --name $USER_ASSIGNED_MI_NAME \
287+
--resource-group $RESOURCE_GROUP \
288+
--location $LOCATION
277289
```
278290
279291
# [PowerShell](#tab/powershell)
@@ -309,7 +321,9 @@ Some Azure IoT Operations components like dataflow endpoints use user-assigned m
309321
USER_ASSIGNED_MI_RESOURCE_ID=$(az identity show --name $USER_ASSIGNED_MI_NAME --resource-group $RESOURCE_GROUP --query id --output tsv)
310322
311323
#Assign the identity to the Azure IoT Operations instance
312-
az iot ops identity assign --name $INSTANCE_NAME --resource-group $RESOURCE_GROUP --mi-user-assigned $USER_ASSIGNED_MI_RESOURCE_ID
324+
az iot ops identity assign --name $INSTANCE_NAME \
325+
--resource-group $RESOURCE_GROUP \
326+
--mi-user-assigned $USER_ASSIGNED_MI_RESOURCE_ID
313327
```
314328
315329
# [PowerShell](#tab/powershell)

0 commit comments

Comments
 (0)