Skip to content

Commit 429fcd8

Browse files
committed
Updated article with functioning commands
1 parent c92dc96 commit 429fcd8

File tree

1 file changed

+17
-28
lines changed

1 file changed

+17
-28
lines changed

articles/aks/trusted-access-feature.md

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,28 @@ In the same subscription as the Azure resource that you want to access the clust
4747

4848
The roles that you select depend on the Azure services that you want to access the AKS cluster. Azure services help create roles and role bindings that build the connection from the Azure service to AKS.
4949

50+
To find the roles that you need, see the documentation for the Azure service that you want to connect to AKS. You can also use the Azure CLI to list the roles that are available for the Azure service. For example, to list the roles for Azure Machine Learning, use the following command:
51+
52+
```azurecli-interactive
53+
az aks trustedaccess role list --location $LOCATION
54+
```
55+
5056
## Create a Trusted Access role binding
5157

5258
After you confirm which role to use, use the Azure CLI to create a Trusted Access role binding in the AKS cluster. The role binding associates your selected role with the Azure service.
5359

5460
```azurecli
5561
# Create a Trusted Access role binding in an AKS cluster
5662
57-
az aks trustedaccess rolebinding create --resource-group <AKS resource group> --cluster-name <AKS cluster name> -n <role binding name> -s <connected service resource ID> --roles <roleName1, roleName2>
63+
az aks trustedaccess rolebinding create --resource-group $RESOURCE_GROUP_NAME --cluster-name $CLUSTER_NAME --name $ROLE_BINDING_NAME --source-resource-id $SOURCE_RESOURCE_ID --roles $ROLE_NAME_1,$ROLE_NAME_2
5864
```
5965

6066
Here's an example:
6167

6268
```azurecli
6369
# Sample command
6470
65-
az aks trustedaccess rolebinding create \
66-
-g myResourceGroup \
67-
--cluster-name myAKSCluster -n test-binding \
68-
--source-resource-id /subscriptions/000-000-000-000-000/resourceGroups/myResourceGroup/providers/Microsoft.MachineLearningServices/workspaces/MyMachineLearning \
69-
--roles Microsoft.Compute/virtualMachineScaleSets/test-node-reader,Microsoft.Compute/virtualMachineScaleSets/test-admin
71+
az aks trustedaccess rolebinding create --resource-group myResourceGroup --cluster-name myAKSCluster --name test-binding --source-resource-id /subscriptions/000-000-000-000-000/resourceGroups/myResourceGroup/providers/Microsoft.MachineLearningServices/workspaces/MyMachineLearning --roles Microsoft.MachineLearningServices/workspaces/mlworkload
7072
```
7173

7274
## Update an existing Trusted Access role binding
@@ -76,39 +78,26 @@ For an existing role binding that has an associated source service, you can upda
7678
> [!NOTE]
7779
> The add-on manager updates clusters every five minutes, so the new role binding might take up to five minutes to take effect. Before the new role binding takes effect, the existing role binding still works.
7880
>
79-
> You can use `az aks trusted access rolebinding list --name <role binding name> --resource-group <resource group>` to check the current role binding.
80-
81-
```azurecli
82-
# Update the RoleBinding command
83-
84-
az aks trustedaccess rolebinding update --resource-group <AKS resource group> --cluster-name <AKS cluster name> -n <existing role binding name> --roles <newRoleName1, newRoleName2>
85-
```
81+
> You can use the `az aks trusted access rolebinding list` command to check the current role binding.
8682
87-
Here's an example:
88-
89-
```azurecli
90-
# Update the RoleBinding command with sample resource group, cluster, and roles
91-
92-
az aks trustedaccess rolebinding update \
93-
--resource-group myResourceGroup \
94-
--cluster-name myAKSCluster -n test-binding \
95-
--roles Microsoft.Compute/virtualMachineScaleSets/test-node-reader,Microsoft.Compute/virtualMachineScaleSets/test-admin
83+
```azurecli-interactive
84+
az aks trustedaccess rolebinding update --resource-group $RESOURCE_GROUP_NAME --cluster-name $CLUSTER_NAME --name $ROLE_BINDING_NAME --roles $ROLE_NAME_3,$ROLE_NAME_4
9685
```
9786

9887
## Show a Trusted Access role binding
9988

10089
Show a specific Trusted Access role binding by using the `az aks trustedaccess rolebinding show` command:
10190

102-
```azurecli
103-
az aks trustedaccess rolebinding show --name <role binding name> --resource-group <AKS resource group> --cluster-name <AKS cluster name>
91+
```azurecli=interactive
92+
az aks trustedaccess rolebinding show --name $ROLE_BINDING_NAME --resource-group $RESOURCE_GROUP_NAME --cluster-name $CLUSTER_NAME
10493
```
10594

10695
## List all the Trusted Access role bindings for a cluster
10796

10897
List all the Trusted Access role bindings for a cluster by using the `az aks trustedaccess rolebinding list` command:
10998

110-
```azurecli
111-
az aks trustedaccess rolebinding list --resource-group <AKS resource group> --cluster-name <AKS cluster name>
99+
```azurecli-interactive
100+
az aks trustedaccess rolebinding list --resource-group $RESOURCE_GROUP_NAME --cluster-name $CLUSTER_NAME
112101
```
113102

114103
## Delete a Trusted Access role binding for a cluster
@@ -118,8 +107,8 @@ az aks trustedaccess rolebinding list --resource-group <AKS resource group> --cl
118107
119108
Delete an existing Trusted Access role binding by using the `az aks trustedaccess rolebinding delete` command:
120109

121-
```azurecli
122-
az aks trustedaccess rolebinding delete --name <role binding name> --resource-group <AKS resource group> --cluster-name <AKS cluster name>
110+
```azurecli-interactive
111+
az aks trustedaccess rolebinding delete --name $ROLE_BINDING_NAME --resource-group $RESOURCE_GROUP_NAME --cluster-name $CLUSTER_NAME
123112
```
124113

125114
## Related content

0 commit comments

Comments
 (0)