From 12ee06a39f2b72b72441e4010f3394bf2f2b0f08 Mon Sep 17 00:00:00 2001 From: grzmax <62957741+grzmax@users.noreply.github.com> Date: Tue, 28 May 2024 14:11:35 +0200 Subject: [PATCH] output none added to federatedToken --- Tasks/AzureCLIV2/azureclitask.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Tasks/AzureCLIV2/azureclitask.ts b/Tasks/AzureCLIV2/azureclitask.ts index f4caaf85060f..69d16cc00875 100644 --- a/Tasks/AzureCLIV2/azureclitask.ts +++ b/Tasks/AzureCLIV2/azureclitask.ts @@ -150,8 +150,12 @@ export class azureclitask { const federatedToken = await this.getIdToken(connectedService); tl.setSecret(federatedToken); - const args = `login --service-principal -u "${servicePrincipalId}" --tenant "${tenantId}" --allow-no-subscriptions --federated-token "${federatedToken}"`; - + if (visibleAzLogin) { + const args = `login --service-principal -u "${servicePrincipalId}" --tenant "${tenantId}" --allow-no-subscriptions --federated-token "${federatedToken}"`; + } + else { + const args = `login --service-principal -u "${servicePrincipalId}" --tenant "${tenantId}" --allow-no-subscriptions --federated-token "${federatedToken}" --output none`; + } //login using OpenID Connect federation Utility.throwIfError(tl.execSync("az", args), tl.loc("LoginFailed"));