Skip to content

Commit 994ce0a

Browse files
author
naman-msft
committed
updated docs;
1 parent e730056 commit 994ce0a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

scenarios/azure-management-docs/articles/azure-linux/quickstart-azure-cli.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,13 @@ Create an AKS cluster using the `az aks create` command with the `--os-sku` para
6565

6666
```azurecli-interactive
6767
export MY_AZ_CLUSTER_NAME="myAzureLinuxCluster$RANDOM_ID"
68+
clusterExists=$(az aks show --name $MY_AZ_CLUSTER_NAME --resource-group $MY_RESOURCE_GROUP_NAME --query name --output tsv 2>/dev/null)
6869
69-
az aks create --name $MY_AZ_CLUSTER_NAME --resource-group $MY_RESOURCE_GROUP_NAME --os-sku AzureLinux
70+
if [ -z "$clusterExists" ]; then
71+
az aks create --name $MY_AZ_CLUSTER_NAME --resource-group $MY_RESOURCE_GROUP_NAME --os-sku AzureLinux
72+
else
73+
echo "AKS cluster '$MY_AZ_CLUSTER_NAME' already exists. Skipping creation."
74+
fi
7075
```
7176

7277
After a few minutes, the command completes and returns JSON-formatted information about the cluster.

0 commit comments

Comments
 (0)