locked
Azure CLI aks (azure kubernetes service) commandlet is not identified RRS feed

  • Question

  • Hi I am using Windows power shell version 5.1 and have .net framework 4.6 along with azure cli 2.0 with elevated privileges.

    However when i am trying to use aks it is not able to identify the commandlets. I am clueless if i need any other download to tryout aks from powershell.

    The error i get is as below:-

    ======================================================================

    Windows PowerShell
    Copyright (C) 2016 Microsoft Corporation. All rights reserved.

    PS C:\Users\30197821> $psversiontable

    Name                           Value
    ----                           -----
    PSVersion                      5.1.14409.1012
    PSEdition                      Desktop
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
    BuildVersion                   10.0.14409.1012
    CLRVersion                     4.0.30319.42000
    WSManStackVersion              3.0
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1


    PS C:\Users\30197821> az aks list myResourceGroup
    az: error: argument _command_package: invalid choice: aks
    usage: az [-h] [--output {json,tsv,table,jsonc}] [--verbose] [--debug]
              [--query JMESPATH]
              {acr,acs,webapp,appservice,functionapp,backup,batch,billing,cdn,cloud,cognitiveservices,component,configure,co
    nsumption,container,cosmosdb,dla,dls,eventgrid,extension,feedback,find,interactive,iot,keyvault,lab,monitor,network,logi
    n,logout,account,mysql,postgres,redis,group,resource,provider,feature,tag,policy,lock,managedapp,role,ad,sf,sql,storage,
    vm,vmss,disk,snapshot,image}

    ==============================================================================


    Saurabh Jain HCL Technical Architect MWSOA

    Friday, October 27, 2017 8:20 AM

Answers

  • As it happens, I do have an answer. The problem was fixed for me by doing the following:

    1. Closing all my shells (including VS, and VS Code)
    2. Downloading and installing the new version of the Azure CLI (version 2) Instruction are found at: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest 
    3. I also had to reboot, at that point opening any shell that had the new CLI in the path, resulted in 'AZ AKS' commands being available.

    Hopefully, that will help. As it turns out, it was a shell issue.


    -Stuart

    • Marked as answer by SaurabhJain Tuesday, October 31, 2017 5:05 AM
    Tuesday, October 31, 2017 3:07 AM

All replies

  • The error is pretty explicit.  Read it carefully.  There is no such choice as "aks".

    \_(ツ)_/

    Friday, October 27, 2017 11:03 AM
  • According to the documentation:

    az aks list [--resource-group]

    az aks list --resource-group myResourceGroup


    \_(ツ)_/

    Friday, October 27, 2017 11:07 AM
  • same error, the issue is that it is not recognizing aks

    PS C:\Users\30197821> az aks list --resource-group myResourceGroup

    az: error: argument _command_package: invalid choice: aks
    usage: az [-h] [--output {json,tsv,table,jsonc}] [--verbose] [--debug]
              [--query JMESPATH]
              {acr,acs,webapp,appservice,functionapp,backup,batch,billing,cdn,cloud,cognitiveservices,component,configure,co
    nsumption,container,cosmosdb,dla,dls,eventgrid,extension,feedback,find,interactive,iot,keyvault,lab,monitor,network,logi
    n,logout,account,mysql,postgres,redis,group,resource,provider,feature,tag,policy,lock,managedapp,role,ad,sf,sql,storage,
    vm,vmss,disk,snapshot,image}


    Saurabh Jain HCL Technical Architect MWSOA

    Friday, October 27, 2017 12:07 PM
  • Post in azure forum.  The version you have does not list AKS as a valid target.


    \_(ツ)_/

    Friday, October 27, 2017 1:21 PM
  • So this answer is unhelpful. The purpose of this forum is to help out with scripting questions, obviously, some powershell library or extension is needed to support the AKS sub-command using 'AZ', the question is what do we need to do? A useful answer would include a resolution, such as "Go and download this", or "Enter this command". If you can't be helpful, please don't post.

    -Stuart

    Tuesday, October 31, 2017 12:16 AM
  • So this answer is unhelpful. The purpose of this forum is to help out with scripting questions, obviously, some powershell library or extension is needed to support the AKS sub-command using 'AZ', the question is what do we need to do? A useful answer would include a resolution, such as "Go and download this", or "Enter this command". If you can't be helpful, please don't post.

    -Stuart

    Your comments and objections are unhelpful. If you have a solution then post it - otherwise stop wining.

    Azure issues can more quickly be solved in an Azure forum.

    The documentation an help do not list the item.  If you know why then say so.  Bitching is no help to anyone.


    \_(ツ)_/

    Tuesday, October 31, 2017 12:42 AM
  • As it happens, I do have an answer. The problem was fixed for me by doing the following:

    1. Closing all my shells (including VS, and VS Code)
    2. Downloading and installing the new version of the Azure CLI (version 2) Instruction are found at: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest 
    3. I also had to reboot, at that point opening any shell that had the new CLI in the path, resulted in 'AZ AKS' commands being available.

    Hopefully, that will help. As it turns out, it was a shell issue.


    -Stuart

    • Marked as answer by SaurabhJain Tuesday, October 31, 2017 5:05 AM
    Tuesday, October 31, 2017 3:07 AM
  • Thanks Stuart that helped me..and i was looking for the kind answer that you provided and not something vague. Thanks again

    Saurabh Jain HCL Technical Architect MWSOA

    Tuesday, October 31, 2017 5:07 AM
  • I also posted that you had the wrong version above.  If you had either listened or posted in the Azure forum you would have had a solution.  Why "spook" didn't just say that to begin with instead of bitching is a mystery.

    I recommend that you would get answers that you might be willing to accept about Azure in an Azure forum.


    \_(ツ)_/

    Tuesday, October 31, 2017 5:18 AM