Skip to content

Commit 6de4b5d

Browse files
authored
Use federated connections for storage account (#6939)
1 parent 5b508a2 commit 6de4b5d

File tree

6 files changed

+35
-20
lines changed

6 files changed

+35
-20
lines changed

eng/pipelines/jobs/build.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ jobs:
108108
- _CrossBuildArgs: '-cross'
109109

110110
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
111-
- group: DotNetBuilds storage account read tokens
112111
- _InternalInstallArgs: >-
113112
-RuntimeSourceFeed https://dotnetbuilds.blob.core.windows.net/internal
114113
-RuntimeSourceFeedKey $(dotnetbuilds-internal-container-read-token-base64)
@@ -140,6 +139,9 @@ jobs:
140139
- ${{ each step in parameters.preBuildSteps }}:
141140
- ${{ step }}
142141

142+
# Populate internal runtime access variables
143+
- template: /eng/common/templates/steps/enable-internal-runtimes.yml
144+
143145
- script: >-
144146
$(Build.SourcesDirectory)/eng/cibuild$(scriptExt)
145147
-configuration ${{ parameters.configuration }}

eng/pipelines/jobs/pack-sign-publish.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
variables:
1616
- _BuildConfig: Release
1717
- _SignType: real
18-
- group: DotNetBuilds storage account read tokens
1918
steps:
2019
- task: DownloadPipelineArtifact@2
2120
displayName: Download Binaries
@@ -35,6 +34,8 @@ jobs:
3534
- template: /eng/pipelines/steps/setup-nuget-sources.yml@self
3635
parameters:
3736
osGroup: Windows
37+
# Populate internal runtime access variables
38+
- template: /eng/common/templates/steps/enable-internal-runtimes.yml
3839
- script: >-
3940
$(Build.SourcesDirectory)/eng/cipacksignpublish.cmd
4041
/p:TeamName=$(_TeamName)

eng/pipelines/jobs/sign-binaries.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
variables:
1616
- _BuildConfig: ${{ parameters.configuration }}
1717
- _SignType: real
18-
- group: DotNetBuilds storage account read tokens
1918

2019
steps:
2120
- task: DownloadPipelineArtifact@2
@@ -28,6 +27,9 @@ jobs:
2827
parameters:
2928
osGroup: Windows
3029

30+
# Populate internal runtime access variables
31+
- template: /eng/common/templates/steps/enable-internal-runtimes.yml
32+
3133
- script: >-
3234
$(Build.SourcesDirectory)/restore.cmd
3335
-configuration ${{ parameters.configuration }}

eng/pipelines/jobs/test-binaries.yml

+2-15
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,11 @@ jobs:
7979

8080
- ${{ if eq(parameters.useHelix, 'true')}}:
8181
- ${{ if ne(parameters.osGroup, 'Linux_Musl')}}:
82-
# Linux builds (of all variants) run in Mariner containers and do not include pwsh by default
8382
- ${{ if eq(parameters.osGroup, 'Linux') }}:
84-
- script: |
85-
$(Build.SourcesDirectory)/restore.sh
86-
$(Build.SourcesDirectory)/.dotnet/dotnet tool install --global PowerShell
87-
echo "##vso[task.prependpath]/home/cloudtest_azpcontainer/.dotnet/tools"
88-
displayName: Install pwsh
89-
9083
# Calculate the fully qualified Nodejs version first so that any new releases will result in a new cache key
9184
- script: |
92-
pwsh ../eng/helix/GetNodejsVersion.ps1 -MajorVersion $(NodeMajorVersion) -TaskVariableName 'FqNodejsVersion'
85+
pwsh ./eng/helix/GetNodejsVersion.ps1 -MajorVersion $(NodeMajorVersion) -TaskVariableName 'FqNodejsVersion'
9386
displayName: Calculate Node.js version Linux
94-
workingDirectory: "$(Build.SourcesDirectory)/.dotnet"
95-
env:
96-
DOTNET_ROOT: "$(Build.SourcesDirectory)/.dotnet"
9787
9888
- task: Cache@2
9989
displayName: Node.js Cache Linux
@@ -103,11 +93,8 @@ jobs:
10393
path: $(HelixNodejsPayloadPath)
10494

10595
- script: |
106-
pwsh ../eng/helix/InstallNodejs.ps1 -Version $(FqNodejsVersion) -Architecture ${{ parameters.architecture }} -DestinationFolder "$(HelixNodejsPayloadPath)"
96+
pwsh ./eng/helix/InstallNodejs.ps1 -Version $(FqNodejsVersion) -Architecture ${{ parameters.architecture }} -DestinationFolder "$(HelixNodejsPayloadPath)"
10797
displayName: Hydrate Node.js Installation Linux
108-
workingDirectory: "$(Build.SourcesDirectory)/.dotnet"
109-
env:
110-
DOTNET_ROOT: "$(Build.SourcesDirectory)/.dotnet"
11198
11299
- ${{ else }}:
113100
- pwsh: eng/helix/GetNodejsVersion.ps1

eng/pipelines/jobs/tpn.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ jobs:
88
variables:
99
- _InternalInstallArgs: ''
1010
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
11-
- group: DotNetBuilds storage account read tokens
1211
- _InternalInstallArgs: >-
1312
/p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal
1413
/p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
@@ -17,6 +16,9 @@ jobs:
1716
parameters:
1817
osGroup: Windows
1918

19+
# Populate internal runtime access variables
20+
- template: /eng/common/templates/steps/enable-internal-runtimes.yml
21+
2022
# Only restore the projects that are shipped so only packages we ship get included in the below CG scan
2123
- script: >-
2224
$(Build.SourcesDirectory)/restore.cmd -ci

eng/pipelines/stages/preparerelease.yml

+22-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ stages:
2020
- group: DotNet-Diagnostics-Storage
2121
- group: DotNet-DotNetStage-Storage
2222
- group: Release-Pipeline
23-
- group: DotNetBuilds storage account read tokens
2423
steps:
2524
- task: UseDotNet@2
2625
displayName: 'Use .NET 6'
@@ -49,6 +48,28 @@ stages:
4948
-MaestroToken $(MaestroAccessToken)
5049
-TaskVariableName 'BuildVersion'
5150
51+
# Populate dotnetbuilds-internal-container-read-token
52+
- template: /eng/common/templates-official/steps/get-delegation-sas.yml
53+
parameters:
54+
federatedServiceConnection: 'dotnetbuilds-internal-read'
55+
outputVariableName: 'dotnetbuilds-internal-checksums-container-read-token'
56+
expiryInHours: 1
57+
base64Encode: false
58+
storageAccount: dotnetbuilds
59+
container: internal-checksums
60+
permissions: rl
61+
62+
# Populate dotnetbuilds-internal-container-read-token
63+
- template: /eng/common/templates-official/steps/get-delegation-sas.yml
64+
parameters:
65+
federatedServiceConnection: 'dotnetbuilds-internal-read'
66+
outputVariableName: 'dotnetbuilds-internal-container-read-token'
67+
expiryInHours: 1
68+
base64Encode: false
69+
storageAccount: dotnetbuilds
70+
container: internal
71+
permissions: rl
72+
5273
- task: AzureCLI@2
5374
displayName: 'Download Build Assets'
5475
inputs:

0 commit comments

Comments
 (0)