Skip to content

Commit

Permalink
use AFD link over SASUrl (#834)
Browse files Browse the repository at this point in the history
  • Loading branch information
anamnavi authored Oct 21, 2024
1 parent 7ed1970 commit c452f6e
Showing 1 changed file with 4 additions and 25 deletions.
29 changes: 4 additions & 25 deletions .vsts-ci/releaseJob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,31 +72,10 @@ jobs:
displayName: Get Proper ImageName and ContextFolder
name: setImageNameStep
- pwsh: |
$modules = 'Az.Accounts', 'Az.Storage'
foreach ($module in $modules) {
if (!(Get-Module $module -listavailable)) {
Write-Host "installing $module..." -verbose
Install-Module $module -force -allowclobber
} else {
Write-Host "$module is already installed" -verbose
}
}
displayName: 'Install AzAccounts'
- task: AzurePowerShell@5
inputs:
azureSubscription: az-blob-cicd-infra
scriptType: inlineScript
azurePowerShellVersion: latestVersion
pwsh: true
inline: |
$containerName = Out-String -InputObject $(DOCKERNAMESPACE) -NoNewline
$containerName = $containerName.Replace('.', '-')
$context = New-AzStorageContext -StorageAccountName $(StorageAccount)
$querystring = New-AzStorageContainerSASToken -Context $context -Name $containerName -Permission r -ExpiryTime ((get-date).AddMinutes(180)) -Protocol HttpsOnly
$uriBuilder = [System.UriBuilder]::new("https://$(StorageAccount).blob.core.windows.net")
$uriBuilder.Query = $querystring.ToString()
$url = $uriBuilder.ToString()
Write-Host "##vso[task.setvariable variable=SasUrl;]$url"
$afdUri = "https://powershellinfraartifacts-gkhedzdeaghdezhr.z01.azurefd.net/install/?fakesas=yes"
$uriObj = [System.Uri]::new($uri)
$url = $uriObj.ToString()
Write-Host "##vso[task.setvariable variable=SasUrl;]$url"
displayName: 'Set SasUrl variable'
- pwsh: |
Get-ChildItem env: | Out-String -Width 1000
Expand Down

0 comments on commit c452f6e

Please sign in to comment.