Skip to content

Instantly share code, notes, and snippets.

@kostakoff
Created September 13, 2026 19:51
Show Gist options
  • Select an option

  • Save kostakoff/99fece7a7dbd2e4e3b2a883cd0a6a20f to your computer and use it in GitHub Desktop.

Select an option

Save kostakoff/99fece7a7dbd2e4e3b2a883cd0a6a20f to your computer and use it in GitHub Desktop.
New-AzAksNodePool with hypervisor type UseWindowsGen2VM
$rgName = "my-rg"
$cluster = "my-aks"
$nodepoolname = "scale"
$subscription = "00000000-0000-0000-0000-000000000000"
$vnetName = "my-vnet"
$aksSubnetName = "aks-subnet"
$tenantId = "00000000-0000-0000-0000-000000000000"
# Устанавливаем контекст — используем tenantId
Set-AzContext -TenantId $tenantId -SubscriptionId $subscription
$customHeader = @{ "UseWindowsGen2VM" = [string[]]("true") }
New-AzAksNodePool `
-ResourceGroupName $rgName `
-ClusterName $cluster `
-Name $nodepoolname `
-VmSetType "VirtualMachineScaleSets" `
-Count 1 `
-VmSize "Standard_F4as_v6" `
-OsType "Windows" `
-OsSku "Windows2022" `
-AksCustomHeader $customHeader `
-VnetSubnetID "/subscriptions/$subscription/resourceGroups/$rgName/providers/Microsoft.Network/virtualNetworks/$vnetName/subnets/$aksSubnetName"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment