Skip to content

Commit

Permalink
Obtain token if not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaMilosavljevic committed Oct 1, 2024
1 parent a930c7b commit 21ede77
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions eng/Get-DropVersions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,16 @@ if ($UseInternalBuild) {
}

if ($BuildId) {
if ($InternalArtifactsAccessToken) {
$internalBaseUrl = GetInternalBaseUrl
}
else {
Write-Error "'InternalArtifactsAccessToken' parameter is required for obtaining internal base-url, when specifying 'BuildId' option"
exit 1
if (!$InternalArtifactsAccessToken) {
$InternalArtifactsAccessToken = az account get-access-token --query accessToken --output tsv
if ($LASTEXITCODE -ne 0) {
Write-Error "Failed to obtain access token using Azure CLI"
Write-Error "Please provide 'InternalArtifactsAccessToken' parameter when using 'BuildId' option"
exit 1
}
}

$internalBaseUrl = GetInternalBaseUrl
}

$queryString = "$BlobStorageSasQueryString"
Expand Down

0 comments on commit 21ede77

Please sign in to comment.