az acs kubernetes get-credentials fails with error The api-version '2017-07-01' is invalid RRS feed

  • Question

  • Describe the bug
    successfully login usinag az login --service-principal -u ${CLIENT_ID} -p ${SECRET_KEY} --tenant ${TENENT_ID}
    but next command to get credentials
    az acs kubernetes get-credentials --resource-group=${RESOURCE_GROUP_NAME} --name=${CLUSTER_NAME} -f ${LOCAL_CONFIG_DIR}/kube_config --ssh-key-file ${SSH_FILE_PATH}

    This fails with error
    The api-version '2017-07-01' is invalid. The supported versions are '2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'.

    To Reproduce
    create acs cluster
    az login
    az acs kubernetes get-credentials

    Expected behavior
    I was getting kubeconfig file and suddenly it stops working with this error

    Environment summary
    Installed azure-cli from

    CLI version and info

    azure-cli (2.0.38)
    acr (2.0.27)
    acs (2.1.1)
    advisor (0.5.1)
    ams (0.1.1)
    appservice (0.1.35)
    backup (1.1.1)
    batch (3.2.4)
    batchai (0.3.0)
    billing (0.1.8)
    cdn (0.0.14)
    cloud (2.0.14)
    cognitiveservices (0.1.13)
    command-modules-nspkg (2.0.1)
    configure (2.0.16)
    consumption (0.3.1)
    container (0.1.24)
    core (2.0.38)
    cosmosdb (0.1.21)
    dla (0.1.0)
    dls (0.0.22)
    dms (0.0.1)
    eventgrid (0.1.12)
    eventhubs (0.1.3)
    extension (0.0.15)
    feedback (2.1.2)
    find (0.2.10)
    interactive (0.3.23)
    iot (0.1.21)
    keyvault (2.0.22)
    lab (0.0.22)
    maps (0.2.0)
    monitor (0.1.7)
    network (2.1.4)
    nspkg (3.0.2)
    policyinsights (0.1.0)
    profile (2.0.26)
    rdbms (0.2.4)
    redis (0.2.13)
    reservations (0.2.0)
    resource (2.0.31)
    role (2.0.26)
    servicebus (0.1.2)
    servicefabric (0.0.12)
    sql (2.0.27)
    storage (2.0.35)
    vm (2.0.34)

    Additional context
    I tried updating az-cli-acs version to 2.0.16,2.0.14,2.1.1,2.1.0 but everywhere I got same error.

    • Moved by Swikruti Bose Thursday, June 21, 2018 10:43 AM Better suited here than API Management
    Thursday, June 21, 2018 5:59 AM

All replies

  • I have tried with latest version CLI its working as excepted.

    Steps to connect Kubernetes cluster:

    To manage a Kubernetes cluster, use kubectl, the Kubernetes command-line client.

    If you're using Azure CloudShell, kubectl is already installed. If you want to install it locally, you can use the az acs kubernetes install-cli command.

    To configure kubectl to connect to your Kubernetes cluster, run the az acs kubernetes get-credentials command. This step downloads credentials and configures the Kubernetes CLI to use them.

    az acs kubernetes get-credentials --resource-group=myResourceGroup --name=myK8sCluster

    To verify the connection to your cluster, use the kubectl get nodes command to return a list of the cluster nodes.

    For more details, refer “Deploy Kubernetes cluster for Linux Containers”.


    If this answer was helpful, click “Mark as Answer” or “Up-Vote”. To provide additional feedback on your forum experience, click here

    Friday, June 22, 2018 8:51 AM
  • Checking in to see if the above response helped to answer your query. Let us know if there are still any additional issues we can help with.

    Tuesday, June 26, 2018 4:58 AM