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

az login inside containerapp code no longer working. #30832

Open
cwash05 opened this issue Feb 15, 2025 · 4 comments
Open

az login inside containerapp code no longer working. #30832

cwash05 opened this issue Feb 15, 2025 · 4 comments
Assignees
Labels
Account az login/account Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. Possible-Solution Service Attention This issue is responsible by Azure service team. Similar-Issue
Milestone

Comments

@cwash05
Copy link

cwash05 commented Feb 15, 2025

Describe the bug

Before the CLI change to 'az login --identity' I 'az login --identity --username' to login and the run 'az aks get-credentials'

Related command

 string command = $"-c \"az login --identity --username {manageId} && az aks get-credentials --resource-group {buildInfo.resourceGroupName} --name {buildInfo.clusterName} --overwrite-existing\""; // Command to log in to Azure

 // Create a process start info
 ProcessStartInfo loginInfo = new ProcessStartInfo
 {
     FileName = "bash", 
     Arguments = command, 
     RedirectStandardOutput = true,
     RedirectStandardError = true, 
     UseShellExecute = false 
 };

 // Create and start the process
 using (Process process = new Process())
 {
     process.StartInfo = loginInfo;
     process.Start();

     
     string output = process.StandardOutput.ReadToEnd();
     string error = process.StandardError.ReadToEnd();

     // Wait for the process to exit
     process.WaitForExit();

     // Check exit code
     int exitCode = process.ExitCode;
     if (exitCode == 0)
     {
         // Command executed successfully
         Console.WriteLine("Command executed successfully");
         Console.WriteLine($"Output: {output}");
     }
     else
     {
         // Command failed
         Console.WriteLine($"Command failed with exit code {exitCode}");
         Console.WriteLine($"Error output: {error}");
     }
 }

Errors

ERROR: Failed to connect to MSI. Please make sure MSI is configured correctly.

Error occurs even after updating the command to use '--client-id'

Issue script & Debug output

N/A

Expected behavior

Expected to be able to login to azure cli

Environment Summary

Whatever version of CLI is running inside Azure Container App

Additional context

No response

@cwash05 cwash05 added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Feb 15, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added AKS az aks/acs/openshift Service Attention This issue is responsible by Azure service team. labels Feb 15, 2025
@yonzhan
Copy link
Collaborator

yonzhan commented Feb 15, 2025

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added Auto-Assign Auto assign by bot Account az login/account labels Feb 15, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Feb 15, 2025
Copy link

Here are some similar issues that might help you. Please check if they can solve your problem.


Possible solution (Extracted from existing issue, might be incorrect; please verify carefully)

az login --identity is only used for managed identity on Azure resources. Please make sure az login --identity is invoked on an Azure resource, like Azure VM, and managed identity is configured correctly.

Reference:

Powered by issue-sentinel

Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @dyu1208, @FumingZhang, @andyliuliming.

@yonzhan yonzhan removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Azure CLI Team The command of the issue is owned by Azure CLI team labels Feb 15, 2025
@yonzhan yonzhan added this to the Backlog milestone Feb 15, 2025
@FumingZhang FumingZhang removed the AKS az aks/acs/openshift label Feb 17, 2025
@FumingZhang
Copy link
Member

not related to AKS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Account az login/account Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. Possible-Solution Service Attention This issue is responsible by Azure service team. Similar-Issue
Projects
None yet
Development

No branches or pull requests

4 participants