diff --git a/Tasks/AzureCLIV1/azureclitask.ts b/Tasks/AzureCLIV1/azureclitask.ts index f693d210349c..488106e9853f 100644 --- a/Tasks/AzureCLIV1/azureclitask.ts +++ b/Tasks/AzureCLIV1/azureclitask.ts @@ -144,8 +144,10 @@ export class azureclitask { this.servicePrincipalKey = cliPassword; } + let escapedCliPassword = cliPassword.replace(/"/g, '\\"'); + tl.setSecret(escapedCliPassword.replace(/\\/g, '\"')); //login using svn - this.throwIfError(tl.execSync("az", "login --service-principal -u \"" + servicePrincipalId + "\" -p \"" + cliPassword + "\" --tenant \"" + tenantId + "\""), tl.loc("LoginFailed")); + this.throwIfError(tl.execSync("az", `login --service-principal -u "${servicePrincipalId}" -p "${escapedCliPassword}" --tenant "${tenantId}"`), tl.loc("LoginFailed")); } else if(authScheme.toLowerCase() == "managedserviceidentity") { //login using msi diff --git a/Tasks/AzureCLIV1/task.json b/Tasks/AzureCLIV1/task.json index c136d4e0bdc0..efa650b7445f 100644 --- a/Tasks/AzureCLIV1/task.json +++ b/Tasks/AzureCLIV1/task.json @@ -19,7 +19,7 @@ "demands": [], "version": { "Major": 1, - "Minor": 157, + "Minor": 163, "Patch": 0 }, "minimumAgentVersion": "2.0.0", diff --git a/Tasks/AzureCLIV1/task.loc.json b/Tasks/AzureCLIV1/task.loc.json index 6136a25a4a30..362fcf79431a 100644 --- a/Tasks/AzureCLIV1/task.loc.json +++ b/Tasks/AzureCLIV1/task.loc.json @@ -19,7 +19,7 @@ "demands": [], "version": { "Major": 1, - "Minor": 157, + "Minor": 163, "Patch": 0 }, "minimumAgentVersion": "2.0.0", diff --git a/Tasks/AzureCLIV2/azureclitask.ts b/Tasks/AzureCLIV2/azureclitask.ts index 9bedcd51cca6..d84eae16e545 100644 --- a/Tasks/AzureCLIV2/azureclitask.ts +++ b/Tasks/AzureCLIV2/azureclitask.ts @@ -102,8 +102,10 @@ export class azureclitask { this.servicePrincipalKey = cliPassword; } + let escapedCliPassword = cliPassword.replace(/"/g, '\\"'); + tl.setSecret(escapedCliPassword.replace(/\\/g, '\"')); //login using svn - Utility.throwIfError(tl.execSync("az", "login --service-principal -u \"" + servicePrincipalId + "\" -p \"" + cliPassword + "\" --tenant \"" + tenantId + "\""), tl.loc("LoginFailed")); + Utility.throwIfError(tl.execSync("az", `login --service-principal -u "${servicePrincipalId}" -p "${escapedCliPassword}" --tenant "${tenantId}"`), tl.loc("LoginFailed")); } else if(authScheme.toLowerCase() == "managedserviceidentity") { //login using msi diff --git a/Tasks/AzureCLIV2/src/Utility.ts b/Tasks/AzureCLIV2/src/Utility.ts index 6a46d0428f37..6a360be53130 100644 --- a/Tasks/AzureCLIV2/src/Utility.ts +++ b/Tasks/AzureCLIV2/src/Utility.ts @@ -56,7 +56,7 @@ export class Utility { } contents.push(content.trim()); - let powerShellIgnoreLASTEXITCODE: string = tl.getInput('powerShellIgnoreLASTEXITCODE', false); + let powerShellIgnoreLASTEXITCODE: boolean = tl.getBoolInput('powerShellIgnoreLASTEXITCODE', false); if (!powerShellIgnoreLASTEXITCODE) { contents.push(`if (!(Test-Path -LiteralPath variable:\LASTEXITCODE)) {`); contents.push(` Write-Host '##vso[task.debug]$LASTEXITCODE is not set.'`); diff --git a/Tasks/AzureCLIV2/task.json b/Tasks/AzureCLIV2/task.json index 4ef4ab5fe3f0..723888d70ec6 100644 --- a/Tasks/AzureCLIV2/task.json +++ b/Tasks/AzureCLIV2/task.json @@ -21,7 +21,7 @@ "version": { "Major": 2, "Minor": 0, - "Patch": 5 + "Patch": 7 }, "minimumAgentVersion": "2.0.0", "instanceNameFormat": "Azure CLI $(scriptPath)", diff --git a/Tasks/AzureCLIV2/task.loc.json b/Tasks/AzureCLIV2/task.loc.json index 0fdfe29e685a..1e6284b35d96 100644 --- a/Tasks/AzureCLIV2/task.loc.json +++ b/Tasks/AzureCLIV2/task.loc.json @@ -21,7 +21,7 @@ "version": { "Major": 2, "Minor": 0, - "Patch": 5 + "Patch": 7 }, "minimumAgentVersion": "2.0.0", "instanceNameFormat": "ms-resource:loc.instanceNameFormat",