diff --git a/eng/common/scripts/Prepare-Release.ps1 b/eng/common/scripts/Prepare-Release.ps1 index b3b62e9f96e9..2c7b61522048 100644 --- a/eng/common/scripts/Prepare-Release.ps1 +++ b/eng/common/scripts/Prepare-Release.ps1 @@ -136,6 +136,11 @@ if ($null -eq $newVersionParsed) -packageType $packageProperties.SDKType ` -packageNewLibrary $packageProperties.IsNewSDK +if ($LASTEXITCODE -ne 0) { + Write-Error "Updating of the Devops Release WorkItem failed." + exit 1 +} + if ($releaseTrackingOnly) { Write-Host diff --git a/eng/common/scripts/Update-DevOps-Release-WorkItem.ps1 b/eng/common/scripts/Update-DevOps-Release-WorkItem.ps1 index 92f9a41106ad..b1a45abffa2e 100644 --- a/eng/common/scripts/Update-DevOps-Release-WorkItem.ps1 +++ b/eng/common/scripts/Update-DevOps-Release-WorkItem.ps1 @@ -19,11 +19,17 @@ param( Set-StrictMode -Version 3 if (!(Get-Command az -ErrorAction SilentlyContinue)) { - Write-Host 'You must have the Azure CLI installed: https://aka.ms/azure-cli' + Write-Error 'You must have the Azure CLI installed: https://aka.ms/azure-cli' exit 1 } -az extension show -n azure-devops > $null +az account show *> $null +if (!$?) { + Write-Host 'Running az login...' + az login *> $null +} + +az extension show -n azure-devops *> $null if (!$?){ Write-Host 'Installing azure-devops extension' az extension add --name azure-devops