File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ parameters:
88 ServiceConnection : not-specified
99 ResourceType : test
1010 UseFederatedAuth : false
11+ PersistOidcToken : false
1112
1213# SubscriptionConfiguration will be splatted into the parameters of the test
1314# resources script. It should be JSON in the form:
@@ -41,12 +42,27 @@ steps:
4142
4243 - template : /eng/common/TestResources/setup-environments.yml
4344
45+ - ${{ if parameters.PersistOidcToken }} :
46+ - task : AzureCLI@2
47+ displayName : Set OIDC token
48+ env :
49+ ARM_OIDC_TOKEN : $(ARM_OIDC_TOKEN)
50+ inputs :
51+ azureSubscription : ${{ parameters.ServiceConnection }}
52+ addSpnToEnvironment : true
53+ scriptLocation : inlineScript
54+ scriptType : pscore
55+ inlineScript : |
56+ Write-Host "##vso[task.setvariable variable=ARM_OIDC_TOKEN;issecret=true]$($env:idToken)"
57+
4458 - ${{ if eq('true', parameters.UseFederatedAuth) }} :
4559 - task : AzurePowerShell@5
4660 displayName : 🚀 Deploy test resources
4761 env :
4862 TEMP : $(Agent.TempDirectory)
4963 PoolSubnet : $(PoolSubnet)
64+ ${{ if parameters.PersistOidcToken }} :
65+ ARM_OIDC_TOKEN : $(ARM_OIDC_TOKEN)
5066 ${{ insert }} : ${{ parameters.EnvVars }}
5167 inputs :
5268 azureSubscription : ${{ parameters.ServiceConnection }}
You can’t perform that action at this time.
0 commit comments