From 1b07ea9bb57189c6ba703940a69f3522c74997c1 Mon Sep 17 00:00:00 2001 From: Shiying Chen Date: Fri, 1 Dec 2023 10:07:30 +0800 Subject: [PATCH] Run `az account clear` instead of `az logout` at the beginning (#377) * az account clear * remove catch error --- src/Cli/AzureCliLogin.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Cli/AzureCliLogin.ts b/src/Cli/AzureCliLogin.ts index c69bb75e..91d52278 100644 --- a/src/Cli/AzureCliLogin.ts +++ b/src/Cli/AzureCliLogin.ts @@ -34,12 +34,7 @@ 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}"`); - } + await this.executeAzCliCommand(["account", "clear"], true, execOptions); this.setAzurestackEnvIfNecessary();