Need Azure powershell command to get the Azure Kubernetes Service

10/5/2018

Please help me to find the azure powershell comand to get the list of Azure Kubernetes Service running in the azure tenant using powershell. Please help .

-- Melbin K
azure
azure-aks
azure-kubernetes
azure-powershell
powershell

1 Answer

10/5/2018

you could use get-azurermresource with a where-object to filter down results:

Get-AzureRmResource | ? resourcetype -eq 'Microsoft.ContainerService/managedClusters'

but you'd have to create a loop around all subscriptions.

or you could use new AzureRmGraph module:

Search-AzureRmGraph -Query "where type =~ 'Microsoft.ContainerService/managedClusters'
-- 4c74356b41
Source: StackOverflow