Az.AKS PowerShell Module
The Az.AKS module provides cmdlets for managing Azure Kubernetes Service (AKS) resources.
Installation
Install-Module -Name Az.AKS -Scope CurrentUser -Repository PSGallery -Force
Key Cmdlets
| Cmdlet | Description |
|---|---|
Get-AzAksCluster | Retrieves AKS cluster details. |
New-AzAksCluster | Creates a new AKS cluster. |
Remove-AzAksCluster | Deletes an AKS cluster. |
Update-AzAksCluster | Updates existing AKS cluster configuration. |
Get-AzAksNodePool | Lists node pools in a cluster. |
Add-AzAksNodePool | Adds a new node pool to a cluster. |
Remove-AzAksNodePool | Removes a node pool from a cluster. |
Example: Create a Basic AKS Cluster
# Variables
$rg = "MyResourceGroup"
$location = "eastus"
$clusterName = "myAksCluster"
# Create resource group
New-AzResourceGroup -Name $rg -Location $location
# Create AKS cluster
New-AzAksCluster -ResourceGroupName $rg `
-Name $clusterName `
-NodeCount 3 `
-KubernetesVersion "1.28.0" `
-GenerateSshKey