Skip to content

fix: resolves #5074 #5102

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fix: resolves #5074 #5102

wants to merge 1 commit into from

Conversation

pauldotyu
Copy link

Resolves #5074 by adding tenant id to kubeconfig convert options when cluster is Azure RBAC enabled or local account is disabled.

…tions

when cluster is azure rbac enabled or local account is disabled
@@ -606,6 +606,7 @@ func (t *aksTarget) ensureClusterContext(
convertOptions := &kubelogin.ConvertOptions{
Login: "azd",
KubeConfig: kubeConfigPath,
TenantId: t.env.GetTenantId(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tenantId is not ensured to be in the azd-environment.

We have a way to resolve the tenantId for a project here: https://github.com/Azure/azure-dev/blob/main/cli/azd/cmd/auth_token.go#L84

Most cases, it is resolved from the subscription Id, which is ensured to be in the azd-env

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review @vhvb1989 and got it... Couldn't we also get it directly from the cluster to ensure the kubelogin get-token command is for the exact tenant that it is deployed into and not worry about azd auth env variables?

Suggested change
TenantId: t.env.GetTenantId(),
TenantId: *managedCluster.Properties.AADProfile.TenantID,

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me ping @wbreza as I am not very familiar with the managedCluster

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

Successfully merging this pull request may close these issues.

[Issue] Unable to deploy to AKS cluster with Microsoft Entra ID authentication and Azure RBAC enabled
2 participants