Skip to content

Commit 43b59d5

Browse files
authored
build: partially revert AzCopy changes from 22c509f (#19092)
When we first transitioned to the `R1` network isolation environment--which required us to _not_ contact powershellgallery.com--we had to give up on the `AzureFileCopy` task. Since then, the `AzurePowerShell` task has also become somewhat broken while OneBranch fixed the issue that prevented us from using `AzureFileCopy`. In short, we now need to: - Install the Azure PowerShell modules directly from our own feed (which satisfies the network constraint) - ... using `PSResourceGet` ... - ... for Windows PowerShell 5.1 ... - which is used by `AzureFileCopy` to later perform authentication.
1 parent a25d968 commit 43b59d5

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

.github/actions/spelling/expect/expect.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ autoscrolling
7878
Autowrap
7979
AVerify
8080
awch
81-
AZCOPY
8281
azurecr
8382
AZZ
8483
backgrounded
@@ -1342,7 +1341,6 @@ PROPTITLE
13421341
propvar
13431342
propvariant
13441343
psa
1345-
PSCRED
13461344
PSECURITY
13471345
pseudoconsole
13481346
psh

build/pipelines/templates-v2/job-deploy-to-azure-storage.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,30 @@ jobs:
7575
}
7676
displayName: "Wrangle Unpackaged builds into place, rename"
7777
78-
- task: AzurePowerShell@5
78+
- task: PowerShell@2
79+
displayName: Install Azure Modules from custom PowerShell Gallery Repo
80+
env:
81+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
82+
inputs:
83+
pwsh: false # We are preparing modules for AzureFileCopy, which uses PowerShell 5.1
84+
targetType: inline
85+
script: |-
86+
$MachineToken = $env:SYSTEM_ACCESSTOKEN | ConvertTo-SecureString -AsPlainText -Force
87+
$Credential = [PSCredential]::new("ONEBRANCH_TOKEN", $MachineToken)
88+
$MachineToken = $null
89+
$Feed = "https://pkgs.dev.azure.com/shine-oss/terminal/_packaging/TerminalDependencies/nuget/v3/index.json"
90+
Register-PSResourceRepository -Name "PSGalleryUpstream" -Uri $Feed -Trusted
91+
Get-PSResourceRepository
92+
93+
Install-PSResource -Name Az.Accounts, Az.Storage, Az.Network, Az.Resources, Az.Compute -Repository "PSGalleryUpstream" -Credential $Credential
94+
95+
- task: AzureFileCopy@6
7996
displayName: Publish to Storage Account
8097
inputs:
98+
sourcePath: _out/*
99+
Destination: AzureBlob
81100
azureSubscription: ${{ parameters.subscription }}
82-
azurePowerShellVersion: LatestVersion
83-
pwsh: true
84-
ScriptType: InlineScript
85-
Inline: |-
86-
$Env:AZCOPY_AUTO_LOGIN_TYPE="PSCRED"
87-
& AzCopy copy "_out\*" "https://${{ parameters.storageAccount }}.blob.core.windows.net/${{ parameters.storageContainer }}/" --content-type application/octet-stream
101+
storage: ${{ parameters.storageAccount }}
102+
ContainerName: ${{ parameters.storageContainer }}
103+
AdditionalArgumentsForBlobCopy: "--content-type application/octet-stream"
104+

0 commit comments

Comments
 (0)