Skip to content

Commit e7215e3

Browse files
Merge pull request #275306 from schaffererin/updateparams2
Updated command parameters with long-form formatting
2 parents da695c9 + 2cb0745 commit e7215e3

10 files changed

+46
-46
lines changed

articles/aks/azure-disk-customer-managed-keys.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ az account list-locations
4646

4747
```azurecli-interactive
4848
# Create new resource group in a supported Azure region
49-
az group create -l myAzureRegionName -n myResourceGroup
49+
az group create --location myAzureRegionName --name myResourceGroup
5050
5151
# Create an Azure Key Vault resource in a supported Azure region
52-
az keyvault create -n myKeyVaultName -g myResourceGroup -l myAzureRegionName --enable-purge-protection true
52+
az keyvault create --name myKeyVaultName --resource-group myResourceGroup --location myAzureRegionName --enable-purge-protection true
5353
```
5454

5555
## Create an instance of a DiskEncryptionSet
@@ -64,7 +64,7 @@ keyVaultId=$(az keyvault show --name myKeyVaultName --query "[id]" -o tsv)
6464
keyVaultKeyUrl=$(az keyvault key show --vault-name myKeyVaultName --name myKeyName --query "[key.kid]" -o tsv)
6565
6666
# Create a DiskEncryptionSet
67-
az disk-encryption-set create -n myDiskEncryptionSetName -l myAzureRegionName -g myResourceGroup --source-vault $keyVaultId --key-url $keyVaultKeyUrl
67+
az disk-encryption-set create --name myDiskEncryptionSetName -location myAzureRegionName -resource-group myResourceGroup --source-vault $keyVaultId --key-url $keyVaultKeyUrl
6868
```
6969

7070
> [!IMPORTANT]
@@ -76,10 +76,10 @@ Use the DiskEncryptionSet and resource groups you created on the prior steps, an
7676

7777
```azurecli-interactive
7878
# Retrieve the DiskEncryptionSet value and set a variable
79-
desIdentity=$(az disk-encryption-set show -n myDiskEncryptionSetName -g myResourceGroup --query "[identity.principalId]" -o tsv)
79+
desIdentity=$(az disk-encryption-set show --name myDiskEncryptionSetName --resource-group myResourceGroup --query "[identity.principalId]" -o tsv)
8080
8181
# Update security policy settings
82-
az keyvault set-policy -n myKeyVaultName -g myResourceGroup --object-id $desIdentity --key-permissions wrapkey unwrapkey get
82+
az keyvault set-policy --name myKeyVaultName --resource-group myResourceGroup --object-id $desIdentity --key-permissions wrapkey unwrapkey get
8383
```
8484

8585
## Create a new AKS cluster and encrypt the OS disk
@@ -89,31 +89,31 @@ Either create a new resource group, or select an existing resource group hosting
8989
Run the following command to retrieve the DiskEncryptionSet value and set a variable:
9090

9191
```azurecli-interactive
92-
diskEncryptionSetId=$(az disk-encryption-set show -n mydiskEncryptionSetName -g myResourceGroup --query "[id]" -o tsv)
92+
diskEncryptionSetId=$(az disk-encryption-set show --name mydiskEncryptionSetName --resource-gorup myResourceGroup --query "[id]" -o tsv)
9393
```
9494

9595
If you want to create a new resource group for the cluster, run the following command:
9696

9797
```azurecli-interactive
98-
az group create -n myResourceGroup -l myAzureRegionName
98+
az group create --name myResourceGroup --location myAzureRegionName
9999
```
100100

101101
To create a regular cluster using network-attached OS disks encrypted with your key, you can do so by specifying the `--node-osdisk-type=Managed` argument.
102102

103103
```azurecli-interactive
104-
az aks create -n myAKSCluster -g myResourceGroup --node-osdisk-diskencryptionset-id $diskEncryptionSetId --generate-ssh-keys --node-osdisk-type Managed
104+
az aks create --name myAKSCluster --resource-group myResourceGroup --node-osdisk-diskencryptionset-id $diskEncryptionSetId --generate-ssh-keys --node-osdisk-type Managed
105105
```
106106

107107
To create a cluster with ephemeral OS disk encrypted with your key, you can do so by specifying the `--node-osdisk-type=Ephemeral` argument. You also need to specify the argument `--node-vm-size` because the default vm size is too small and doesn't support ephemeral OS disk.
108108

109109
```azurecli-interactive
110-
az aks create -n myAKSCluster -g myResourceGroup --node-osdisk-diskencryptionset-id $diskEncryptionSetId --generate-ssh-keys --node-osdisk-type Ephemeral --node-vm-size Standard_DS3_v2
110+
az aks create --name myAKSCluster --resource-group myResourceGroup --node-osdisk-diskencryptionset-id $diskEncryptionSetId --generate-ssh-keys --node-osdisk-type Ephemeral --node-vm-size Standard_DS3_v2
111111
```
112112

113113
When new node pools are added to the cluster, the customer-managed key provided during the create process is used to encrypt the OS disk. The following example shows how to deploy a new node pool with an ephemeral OS disk.
114114

115115
```azurecli-interactive
116-
az aks nodepool add --cluster-name $CLUSTER_NAME -g $RG_NAME --name $NODEPOOL_NAME --node-osdisk-type Ephemeral
116+
az aks nodepool add --cluster-name $CLUSTER_NAME --resource-group $RG_NAME --name $NODEPOOL_NAME --node-osdisk-type Ephemeral
117117
```
118118

119119
## Encrypt your AKS cluster data disk
@@ -126,7 +126,7 @@ If you have already provided a disk encryption set during cluster creation, encr
126126
To assign the AKS cluster identity the Contributor role for the diskencryptionset, execute the following commands:
127127

128128
```azurecli-interactive
129-
aksIdentity=$(az aks show -g $RG_NAME -n $CLUSTER_NAME --query "identity.principalId")
129+
aksIdentity=$(az aks show --resource-group $RG_NAME --name $CLUSTER_NAME --query "identity.principalId")
130130
az role assignment create --role "Contributor" --assignee $aksIdentity --scope $diskEncryptionSetId
131131
```
132132

articles/aks/certificate-rotation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Microsoft maintains all certificates mentioned in this section, except for the c
6363
* Check the expiration date of the VMAS agent node certificate using the `az vm run-command invoke` command.
6464

6565
```azurecli-interactive
66-
az vm run-command invoke -g MC_rg_myAKSCluster_region -n vm-name --command-id RunShellScript --query 'value[0].message' -otsv --scripts "openssl x509 -in /etc/kubernetes/certs/apiserver.crt -noout -enddate"
66+
az vm run-command invoke --resource-group MC_rg_myAKSCluster_region --name vm-name --command-id RunShellScript --query 'value[0].message' -otsv --scripts "openssl x509 -in /etc/kubernetes/certs/apiserver.crt -noout -enddate"
6767
```
6868

6969
### Check Virtual Machine Scale Set agent node certificate expiration date
@@ -108,13 +108,13 @@ For any AKS clusters created or upgraded after March 2022, Azure Kubernetes Serv
108108
1. Connect to your cluster using the [`az aks get-credentials`][az-aks-get-credentials] command.
109109

110110
```azurecli-interactive
111-
az aks get-credentials -g $RESOURCE_GROUP_NAME -n $CLUSTER_NAME
111+
az aks get-credentials --resource-group $RESOURCE_GROUP_NAME --name $CLUSTER_NAME
112112
```
113113

114114
2. Rotate all certificates, CAs, and SAs on your cluster using the [`az aks rotate-certs`][az-aks-rotate-certs] command.
115115

116116
```azurecli-interactive
117-
az aks rotate-certs -g $RESOURCE_GROUP_NAME -n $CLUSTER_NAME
117+
az aks rotate-certs --resource-group $RESOURCE_GROUP_NAME --name $CLUSTER_NAME
118118
```
119119

120120
> [!IMPORTANT]
@@ -135,7 +135,7 @@ For any AKS clusters created or upgraded after March 2022, Azure Kubernetes Serv
135135
4. Update the certificate used by `kubectl` using the [`az aks get-credentials`][az-aks-get-credentials] command with the `--overwrite-existing` flag.
136136

137137
```azurecli-interactive
138-
az aks get-credentials -g $RESOURCE_GROUP_NAME -n $CLUSTER_NAME --overwrite-existing
138+
az aks get-credentials --resource-group $RESOURCE_GROUP_NAME --name $CLUSTER_NAME --overwrite-existing
139139
```
140140

141141
5. Verify the certificates have been updated using the [`kubectl get`][kubectl-get] command.

articles/aks/image-cleaner.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ The `eraser-aks-xxxxx` pod deletes within 10 minutes after work completion. You
247247
2. Get the Log Analytics resource ID using the [`az aks show`][az-aks-show] command.
248248

249249
```azurecli-interactive
250-
az aks show -g myResourceGroup -n myManagedCluster
250+
az aks show --resource-group myResourceGroup --name myManagedCluster
251251
```
252252
253253
After a few minutes, the command returns JSON-formatted information about the solution, including the workspace resource ID:

articles/aks/image-integrity.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Image Integrity uses Ratify, Azure Policy, and Gatekeeper to validate signed ima
8787
8888
```azurecli-interactive
8989
export SCOPE="/subscriptions/${SUBSCRIPTION}/resourceGroups/${RESOURCE_GROUP}"
90-
export LOCATION=$(az group show -n ${RESOURCE_GROUP} --query location -o tsv)
90+
export LOCATION=$(az group show --name ${RESOURCE_GROUP} --query location -o tsv)
9191
9292
az policy assignment create --name 'deploy-trustedimages' --policy-set-definition 'af28bf8b-c669-4dd3-9137-1e68fdc61bd6' --display-name 'Audit deployment with unsigned container images' --scope ${SCOPE} --mi-system-assigned --role Contributor --identity-scope ${SCOPE} --location ${LOCATION}
9393
```
@@ -98,8 +98,8 @@ Image Integrity uses Ratify, Azure Policy, and Gatekeeper to validate signed ima
9898
> The policy deploys the Image Integrity feature on your cluster when it detects any update operation on the cluster. If you want to enable the feature immediately, you need to create a policy remediation using the [`az policy remediation create`][az-policy-remediation-create] command.
9999
>
100100
> ```azurecli-interactive
101-
> assignment_id=$(az policy assignment show -n 'deploy-trustedimages' --scope ${SCOPE} --query id -o tsv)
102-
> az policy remediation create -a "$assignment_id" --definition-reference-id deployAKSImageIntegrity -n remediation -g ${RESOURCE_GROUP}
101+
> assignment_id=$(az policy assignment show --name 'deploy-trustedimages' --scope ${SCOPE} --query id -o tsv)
102+
> az policy remediation create --policy-assignment "$assignment_id" --definition-reference-id deployAKSImageIntegrity --name remediation --resource-group ${RESOURCE_GROUP}
103103
> ```
104104
105105
### [Azure portal](#tab/azure-portal)
@@ -218,7 +218,7 @@ If you want to use your own images, see the [guidance for image signing](../cont
218218
* Disable Image Integrity on your cluster using the [`az aks update`][az-aks-update] command with the `--disable-image-integrity` flag.
219219
220220
```azurecli-interactive
221-
az aks update -g myResourceGroup -n MyManagedCluster --disable-image-integrity
221+
az aks update --resource-group myResourceGroup --name MyManagedCluster --disable-image-integrity
222222
```
223223
224224
### Remove policy initiative

articles/aks/reduce-latency-ppg.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Accelerated networking greatly improves networking performance of virtual machin
5555
2. Create a proximity placement group using the [`az ppg create`][az-ppg-create] command. Make sure to note the ID value in the output.
5656
5757
```azurecli-interactive
58-
az ppg create -n myPPG -g myResourceGroup -l centralus -t standard
58+
az ppg create --name myPPG --resource-group myResourceGroup --location centralus --type standard
5959
```
6060
6161
The command produces an output similar to the following example output, which includes the *ID* value you need for upcoming CLI commands.

articles/aks/use-kms-etcd-encryption.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export KEYVAULT_RESOURCE_ID=$(az keyvault create --name MyKeyVault --resource-gr
8989
Assign yourself permissions to create a key:
9090

9191
```azurecli-interactive
92-
az role assignment create --role "Key Vault Crypto Officer" --assignee-object-id $(az ad signed-in-user show --query id --out tsv) --assignee-principal-type "User" --scope $KEYVAULT_RESOURCE_ID
92+
az role assignment create --role "Key Vault Crypto Officer" --assignee-object-id $(az ad signed-in-user show --query id -o tsv) --assignee-principal-type "User" --scope $KEYVAULT_RESOURCE_ID
9393
```
9494

9595
Use `az keyvault key create` to create a key:
@@ -142,7 +142,7 @@ The following sections describe how to assign decrypt and encrypt permissions fo
142142
If your key vault is not set with `--enable-rbac-authorization`, you can use `az keyvault set-policy` to create an Azure key vault policy.
143143

144144
```azurecli-interactive
145-
az keyvault set-policy -n MyKeyVault --key-permissions decrypt encrypt --object-id $IDENTITY_OBJECT_ID
145+
az keyvault set-policy --name MyKeyVault --key-permissions decrypt encrypt --object-id $IDENTITY_OBJECT_ID
146146
```
147147

148148
#### Assign permissions for an RBAC public key vault
@@ -251,7 +251,7 @@ The following sections describe how to assign decrypt and encrypt permissions fo
251251
If your key vault is not set with `--enable-rbac-authorization`, you can use `az keyvault set-policy` to create a key vault policy in Azure:
252252

253253
```azurecli-interactive
254-
az keyvault set-policy -n MyKeyVault --key-permissions decrypt encrypt --object-id $IDENTITY_OBJECT_ID
254+
az keyvault set-policy --name MyKeyVault --key-permissions decrypt encrypt --object-id $IDENTITY_OBJECT_ID
255255
```
256256

257257
#### Assign permissions for an RBAC private key vault

articles/aks/use-managed-identity.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ AKS uses several managed identities for built-in services and add-ons.
9090
2. Create an AKS cluster using the [`az aks create`][az-aks-create] command.
9191
9292
```azurecli-interactive
93-
az aks create -g myResourceGroup -n myManagedCluster --enable-managed-identity
93+
az aks create --resource-group myResourceGroup --name myManagedCluster --enable-managed-identity
9494
```
9595
9696
3. Get credentials to access the cluster using the [`az aks get-credentials`][az-aks-get-credentials] command.
@@ -104,7 +104,7 @@ AKS uses several managed identities for built-in services and add-ons.
104104
To update your existing AKS cluster that's using a service principal to use a system-assigned managed identity, run the [`az aks update`][az-aks-update] command.
105105
106106
```azurecli-interactive
107-
az aks update -g myResourceGroup -n myManagedCluster --enable-managed-identity
107+
az aks update --resource-group myResourceGroup --name myManagedCluster --enable-managed-identity
108108
```
109109

110110
After updating your cluster, the control plane and pods use the managed identity. Kubelet continues using a service principal until you upgrade your agentpool. You can use the `az aks nodepool upgrade --resource-group myResourceGroup --cluster-name myAKSCluster --name mynodepool --node-image-only` command on your nodes to update to a managed identity. A node pool upgrade causes downtime for your AKS cluster as the nodes in the node pools are cordoned/drained and reimaged.
@@ -396,7 +396,7 @@ Now you can create your AKS cluster with your existing identities. Make sure to
396396
1. Confirm your AKS cluster is using the user-assigned managed identity using the [`az aks show`][az-aks-show] command.
397397
398398
```azurecli-interactive
399-
az aks show -g <RGName> -n <ClusterName> --query "servicePrincipalProfile"
399+
az aks show --resource-group <RGName> --name <ClusterName> --query "servicePrincipalProfile"
400400
```
401401
402402
If your cluster is using a managed identity, the output shows `clientId` with a value of **msi**. A cluster using a service principal shows an object ID. For example:
@@ -410,7 +410,7 @@ Now you can create your AKS cluster with your existing identities. Make sure to
410410
2. After confirming your cluster is using a managed identity, find the managed identity's resource ID using the [`az aks show`][az-aks-show] command.
411411
412412
```azurecli-interactive
413-
az aks show -g <RGName> -n <ClusterName> --query "identity"
413+
az aks show --resource-group <RGName> --name <ClusterName> --query "identity"
414414
```
415415
416416
For a user-assigned managed identity, your output should look similar to the following example output:

articles/aks/use-oidc-issuer.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,23 @@ In this article, you learn how to create, update, and manage the OIDC Issuer for
3434
You can create an AKS cluster using the [az aks create][az-aks-create] command with the `--enable-oidc-issuer` parameter to use the OIDC Issuer. The following example creates a cluster named *myAKSCluster* with one node in the *myResourceGroup*:
3535

3636
```azurecli-interactive
37-
az aks create -g myResourceGroup -n myAKSCluster --node-count 1 --enable-oidc-issuer
37+
az aks create --resource-group myResourceGroup --name myAKSCluster --node-count 1 --enable-oidc-issuer
3838
```
3939

4040
## Update an AKS cluster with OIDC Issuer
4141

4242
You can update an AKS cluster using the [az aks update][az-aks-update] command with the `--enable-oidc-issuer` parameter to use the OIDC Issuer. The following example updates a cluster named *myAKSCluster*:
4343

4444
```azurecli-interactive
45-
az aks update -g myResourceGroup -n myAKSCluster --enable-oidc-issuer
45+
az aks update --resource-group myResourceGroup --name myAKSCluster --enable-oidc-issuer
4646
```
4747

4848
## Show the OIDC Issuer URL
4949

5050
To get the OIDC Issuer URL, run the [az aks show][az-aks-show] command. Replace the default values for the cluster name and the resource group name.
5151

5252
```azurecli-interactive
53-
az aks show -n myAKScluster -g myResourceGroup --query "oidcIssuerProfile.issuerUrl" -otsv
53+
az aks show --name myAKScluster --resource-group myResourceGroup --query "oidcIssuerProfile.issuerUrl" -o tsv
5454
```
5555

5656
By default, the Issuer is set to use the base URL `https://{region}.oic.prod-aks.azure.com`, where the value for `{region}` matches the location the AKS cluster is deployed in.
@@ -60,7 +60,7 @@ By default, the Issuer is set to use the base URL `https://{region}.oic.prod-aks
6060
To rotate the OIDC key, run the [az aks oidc-issuer][az-aks-oidc-issuer] command. Replace the default values for the cluster name and the resource group name.
6161

6262
```azurecli-interactive
63-
az aks oidc-issuer rotate-signing-keys -n myAKSCluster -g myResourceGroup
63+
az aks oidc-issuer rotate-signing-keys --name myAKSCluster --resource-group myResourceGroup
6464
```
6565

6666
> [!IMPORTANT]
@@ -73,7 +73,7 @@ az aks oidc-issuer rotate-signing-keys -n myAKSCluster -g myResourceGroup
7373
To get the OIDC Issuer URL, run the [az aks show][az-aks-show] command. Replace the default values for the cluster name and the resource group name.
7474

7575
```azurecli-interactive
76-
az aks show -n myAKScluster -g myResourceGroup --query "oidcIssuerProfile.issuerUrl" -otsv
76+
az aks show --name myAKScluster --resource-group myResourceGroup --query "oidcIssuerProfile.issuerUrl" -o tsv
7777
```
7878

7979
The output should resemble the following:

articles/aks/use-tags.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ When you create or update an AKS cluster with the `--tags` parameter, the follow
7676
2. Verify the tags have been applied to the cluster and its related resources using the [`az aks show`][az-aks-show] command.
7777
7878
```azurecli-interactive
79-
az aks show -g myResourceGroup -n myAKSCluster --query '[tags]'
79+
az aks show --resource-group myResourceGroup --name myAKSCluster --query '[tags]'
8080
```
8181
8282
The following example output shows the tags applied to the cluster:
@@ -107,7 +107,7 @@ When you create or update an AKS cluster with the `--tags` parameter, the follow
107107
2. Verify the tags have been applied to the cluster and its related resources using the [`az aks show`][az-aks-show] command.
108108
109109
```azurecli-interactive
110-
az aks show -g myResourceGroup -n myAKSCluster --query '[tags]'
110+
az aks show --resource-group myResourceGroup --name myAKSCluster --query '[tags]'
111111
```
112112
113113
The following example output shows the tags applied to the cluster:
@@ -147,7 +147,7 @@ When you create or update a node pool with the `--tags` parameter, the tags you
147147
2. Verify that the tags have been applied to the node pool using the [`az aks show`][az-aks-show] command.
148148
149149
```azurecli-interactive
150-
az aks show -g myResourceGroup -n myAKSCluster --query 'agentPoolProfiles[].{nodepoolName:name,tags:tags}'
150+
az aks show --resource-group myResourceGroup --name myAKSCluster --query 'agentPoolProfiles[].{nodepoolName:name,tags:tags}'
151151
```
152152
153153
The following example output shows the tags applied to the node pool:
@@ -187,7 +187,7 @@ When you create or update a node pool with the `--tags` parameter, the tags you
187187
2. Verify the tags have been applied to the node pool using the [`az aks show`][az-aks-show] command.
188188
189189
```azurecli-interactive
190-
az aks show -g myResourceGroup -n myAKSCluster --query 'agentPoolProfiles[].{nodepoolName:name,tags:tags}'
190+
az aks show --resource-group myResourceGroup --name myAKSCluster --query 'agentPoolProfiles[].{nodepoolName:name,tags:tags}'
191191
```
192192
193193
The following example output shows the tags applied to the node pool:

0 commit comments

Comments
 (0)