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

"parameter 'identityResourceID' cannot be empty" when using default MSI #41

Closed
adrianwyatt opened this issue Nov 3, 2020 · 4 comments
Closed

Comments

@adrianwyatt
Copy link

adrianwyatt commented Nov 3, 2020

Logging in with type "MSI" (i.e. -l msi) later fails with parameter 'identityResourceID' cannot be empty. These commands are being run on an Azure VMSS with a system-assigned identity.

Repro commands:

  1. az login --identity
  2. az account set -s {subscription}
  3. sudo az aks get-credentials --resource-group {resourceGroup} --name {clusterName} --overwrite-existing
  4. sudo kubelogin convert-kubeconfig -l msi
  5. sudo kubectl get nodes

At this point we are seeing this error consistently when using any kubectl commands that access the cluster.

Error: failed to get token: failed to create service principal from managed identity  for token refresh: parameter 'identityResourceID' cannot be empty
@adrianwyatt
Copy link
Author

adrianwyatt commented Nov 3, 2020

Perhaps the check of p.identityResourceID == "" here is improper? That would make it fall through to NewServicePrincipalTokenFromMSIWithIdentityResourceID.

if p.clientID == "" {
		if p.identityResourceID == "" {
			// no identity specified, use whatever IMDS default to
			spt, err = adal.NewServicePrincipalTokenFromMSI(
				msiEndpoint,
				p.resourceID,
				callback)
			if err != nil {
				return emptyToken, fmt.Errorf("failed to create service principal from managed identity for token refresh: %s", err)
			}
		}

@haitch
Copy link
Member

haitch commented Nov 3, 2020

can you paste the kubeconfig? you can trim off the sensitive part

@haitch
Copy link
Member

haitch commented Nov 9, 2020

@adrianwyatt @weinong can we close this issue?

@adrianwyatt
Copy link
Author

adrianwyatt commented Nov 9, 2020 via email

@weinong weinong closed this as completed Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants