Skip to content

Get-AzAks is missing the apiServerAccessProfile which is in az aks show #11649

@ElvenSpellmaker

Description

@ElvenSpellmaker

Description of the new feature

It seems the apiServerAccessProfile returned by az aks show isn't in the output for Get-AzAks, is this correct?

From az aks show as an example

{
  …
  "apiServerAccessProfile": {
    "authorizedIpRanges": [
      "123.123.123.123/32"
    ],
  …
}

Using -Debug shows this key isn't coming back on the Get-AzAks call, whereas it does for the generic resource call.

Further to this by doing a generic Get-AzResource the profile is available in the -Debug output.

    "apiServerAccessProfile": {
      "enablePrivateCluster": false
    }

Further to that it can be accessed by using -ExpandProperties and then querying the Property object on the resource.

(Get-AzResource -ResourceType Microsoft.ContainerServic
e/ManagedClusters -ResourceGroupName sonovate-euw-dev-base-compute-rg -Name sonovate-euw-dev
-base-compute-ks -ExpandProperties).Properties.apiServerAccessProfile

enablePrivateCluster
--------------------
               False

EDIT: After more digging it seems the Get-AzAks uses an API version that's 3 years old, whereas Get-AzResource uses one from 2020:
Get-AzAks:

https://management.azure.com/subscriptions/sub-id/resourceGroups/group-name/providers/Microsoft.ContainerService/managedClusters/resourse-name?api-version=2017-08-31

vs Get-AzResource:

https://management.azure.com//subscriptions/sub-id/resourceGroups/group-name/providers/Microsoft.ContainerService/ManagedClusters/resource-name?api-version=2020-03-01

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions