Skip to content

kubelogin get-token --login azurecli stuck on cloudshell #465

Description

@tdihp

Hi,

I have a fresh Azure cloud-shell bash session, with az aks get-credentials ran, then kubelogin convert-kubeconfig -l azurecli. we found kubectl get nodes to be stuck.

checking kubelogin get-token --login azurecli --server-id <redacted> -v 99, I realize it is stuck on:

I0514 02:48:14.721632     935 execCredentialPlugin.go:34] Login Method: azurecli, Environment: AzurePublicCloud, TenantID: , ServerID: <redacted>, ClientID: , IsLegacy: false, msiResourceID: , Timeout: 30s, tokenCacheDir: /home/ping/.kube/cache/kubelogin/, tokenCacheFile: /home/ping/.kube/cache/kubelogin/AzurePublicCloud-<redacted>--.json, AZURE_CONFIG_DIR: 
I0514 02:48:14.721807     935 execCredentialPlugin.go:114] acquire new token

Unfortunately there isn't much logged all the way until it times out with those messages:

Error: failed to get token: expected an empty error but received: AzureCLICredential: ERROR: Failed to connect to MSI. Please make sure MSI is configured correctly.

This error goes away if I explicitly run az login. It looks like NewAzureCLICredential-->GetToken does something unexpected with the vanilla cloud-shell credentials.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions