Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/azcli/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func EnsureAzCliLoginWithProc(proc Proc, cfg *config.ConfigData) (string, error)

// 3) User-assigned Managed Identity (client ID provided)
if clientID != "" {
if err := runLoginCommand(proc, fmt.Sprintf("login --identity -u %s", clientID), "user-assigned managed identity"); err != nil {
if err := runLoginCommand(proc, fmt.Sprintf("login --identity --client-id %s", clientID), "user-assigned managed identity"); err != nil {
return "", err
}
if err := setSubscription(proc, subscriptionID, "user-assigned managed identity"); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/azcli/login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func TestEnsureAzCliLogin_ManagedIdentity_UserAssigned(t *testing.T) {
t.Setenv("AZURE_SUBSCRIPTION_ID", "dummy-subscription-id")

p := &loginCommands{resp: []loginCommandResponses{
{cmd: "login --identity -u dummy-managed-identity-client-id", out: "", err: nil},
{cmd: "login --identity --client-id dummy-managed-identity-client-id", out: "", err: nil},
{cmd: "account set --subscription dummy-subscription-id", out: "", err: nil},
{cmd: "account show --query id -o tsv", out: "sub-id", err: nil},
}}
Expand Down Expand Up @@ -335,7 +335,7 @@ func TestEnsureAzCliLogin_LoginPromptInOutput(t *testing.T) {
// After the command.go fix, stderr content is returned WITH the error, not instead of it
// This test ensures we don't incorrectly think there's a valid login when there isn't
p := &loginCommands{resp: []loginCommandResponses{
{cmd: "login --identity -u cid", out: "", err: nil},
{cmd: "login --identity --client-id cid", out: "", err: nil},
{cmd: "account show --query id -o tsv", out: "sub-id", err: nil},
}}

Expand Down
Loading