Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ElvenSpellmaker opened this issue Apr 21, 2020 · 2 comments · Fixed by #11595
Closed

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

ElvenSpellmaker opened this issue Apr 21, 2020 · 2 comments · Fixed by #11595
Assignees
Labels
AKS Azure PS Team customer-reported feature-request This issue requires a new behavior in the product in order be resolved.
Milestone

Comments

@ElvenSpellmaker
Copy link

ElvenSpellmaker commented Apr 21, 2020

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
@ElvenSpellmaker ElvenSpellmaker added Azure PS Team feature-request This issue requires a new behavior in the product in order be resolved. triage labels Apr 21, 2020
@williamayerst
Copy link

This would be very useful for me.

@ElvenSpellmaker ElvenSpellmaker changed the title Get-AzAks is missing the apiServerAccessProfile in az aks show Get-AzAks is missing the apiServerAccessProfile which is in az aks show Apr 21, 2020
@dingmeng-xue dingmeng-xue added this to the Backlog milestone Apr 23, 2020
@dingmeng-xue
Copy link
Member

Thanks for reporting. ApiServerAccessProfile was supported since Az.Aks 1.1.1. PR is #11595

Below is sample code.

PS C:\Users\dixue> $aks = Get-AzAks
PS C:\Users\dixue> $aks[0].ApiServerAccessProfile

AuthorizedIPRanges EnablePrivateCluster
------------------ --------------------
{}                                False

Please raise your issue if you have further ask.

@dingmeng-xue dingmeng-xue reopened this Jun 9, 2020
@dingmeng-xue dingmeng-xue linked a pull request Jun 9, 2020 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AKS Azure PS Team customer-reported feature-request This issue requires a new behavior in the product in order be resolved.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants