Skip to content

Commit d6a55e4

Browse files
authored
Don't round-trip download through service principal login during stage 1 download (#155)
Security changes on the Azure subscription side have blocked us from using the previous idiom for getting a temporary service principal credential. Instead, use the managed identity service connection directly during download of stage 1 artifacts.
1 parent be335d6 commit d6a55e4

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

azure-pipelines.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -93,30 +93,14 @@ extends:
9393
arguments: '/p:PackageOutputPath=$(Build.ArtifactStagingDirectory)/packages'
9494

9595
- task: AzureCLI@2
96-
displayName: Get stage 1 auth token
96+
displayName: Log in to Azure and clone data
9797
inputs:
9898
azureSubscription: 'SourceDotNet Stage1 Publish'
9999
addSpnToEnvironment: true
100100
scriptType: 'ps'
101101
scriptLocation: 'inlineScript'
102102
inlineScript: |
103-
echo "##vso[task.setvariable variable=ARM_CLIENT_ID]$env:servicePrincipalId"
104-
echo "##vso[task.setvariable variable=ARM_ID_TOKEN]$env:idToken"
105-
echo "##vso[task.setvariable variable=ARM_TENANT_ID]$env:tenantId"
106-
107-
- script: |
108-
echo "Client ID: $(ARM_CLIENT_ID)"
109-
echo "ID Token: $(ARM_ID_TOKEN)"
110-
echo "Tenant ID: $(ARM_TENANT_ID)"
111-
az login --service-principal -u $(ARM_CLIENT_ID) --tenant $(ARM_TENANT_ID) --allow-no-subscriptions --federated-token $(ARM_ID_TOKEN)
112-
displayName: "Login to Azure"
113-
114-
- task: DotNetCoreCLI@2
115-
displayName: Clone All Repositories
116-
inputs:
117-
command: 'build'
118-
projects: 'build.proj'
119-
arguments: '/t:Clone /v:n /bl:$(Build.ArtifactStagingDirectory)/logs/clone.binlog /p:Stage1StorageAccount=netsourceindexstage1 /p:Stage1StorageContainer=stage1'
103+
dotnet build build.proj /t:Clone /v:n /bl:$(Build.ArtifactStagingDirectory)/logs/clone.binlog /p:Stage1StorageAccount=netsourceindexstage1 /p:Stage1StorageContainer=stage1
120104
121105
- task: DotNetCoreCLI@2
122106
displayName: Prepare All Repositories

0 commit comments

Comments
 (0)