mirror of
https://github.com/azure/login.git
synced 2026-03-15 09:20:56 -04:00
Azure/login should logout the active account at the beginning (#376)
* logout at the beginning * remove logout step in test case
This commit is contained in:
@@ -34,6 +34,13 @@ export class AzureCliLogin {
|
||||
await this.executeAzCliCommand(["--version"], true, execOptions);
|
||||
core.debug(`Azure CLI version used:\n${output}`);
|
||||
|
||||
try {
|
||||
await this.executeAzCliCommand(["logout"], true, execOptions);
|
||||
}
|
||||
catch (error) {
|
||||
core.debug(`Ignore logout error: "${error}"`);
|
||||
}
|
||||
|
||||
this.setAzurestackEnvIfNecessary();
|
||||
|
||||
await this.executeAzCliCommand(["cloud", "set", "-n", this.loginConfig.environment], false);
|
||||
|
||||
Reference in New Issue
Block a user