|
1 | | - |
2 | 1 | parameters: |
3 | 2 | ServiceDirectory: not-set |
4 | 3 | ArmTemplateParameters: '@{}' |
@@ -42,16 +41,40 @@ steps: |
42 | 41 |
|
43 | 42 | - template: /eng/common/TestResources/setup-environments.yml |
44 | 43 |
|
45 | | - - task: AzurePowerShell@5 |
46 | | - displayName: Deploy test resources |
47 | | - env: |
48 | | - TEMP: $(Agent.TempDirectory) |
49 | | - inputs: |
50 | | - azureSubscription: ${{ parameters.ServiceConnection }} |
51 | | - azurePowerShellVersion: LatestVersion |
52 | | - pwsh: true |
53 | | - ScriptType: InlineScript |
54 | | - Inline: | |
| 44 | + - ${{ if eq('true', parameters.UseFederatedAuth) }}: |
| 45 | + - task: AzurePowerShell@5 |
| 46 | + displayName: Deploy test resources |
| 47 | + env: |
| 48 | + TEMP: $(Agent.TempDirectory) |
| 49 | + inputs: |
| 50 | + azureSubscription: ${{ parameters.ServiceConnection }} |
| 51 | + azurePowerShellVersion: LatestVersion |
| 52 | + pwsh: true |
| 53 | + ScriptType: InlineScript |
| 54 | + Inline: | |
| 55 | + eng/common/scripts/Import-AzModules.ps1 |
| 56 | +
|
| 57 | + $subscriptionConfiguration = @' |
| 58 | + ${{ parameters.SubscriptionConfiguration }} |
| 59 | + '@ | ConvertFrom-Json -AsHashtable; |
| 60 | +
|
| 61 | + # The subscriptionConfiguration may have ArmTemplateParameters defined, so |
| 62 | + # pass those in via the ArmTemplateParameters flag, and handle any |
| 63 | + # additional parameters from the pipelines via AdditionalParameters |
| 64 | + eng/common/TestResources/New-TestResources.ps1 ` |
| 65 | + -ResourceType '${{ parameters.ResourceType }}' ` |
| 66 | + -ServiceDirectory '${{ parameters.ServiceDirectory }}' ` |
| 67 | + -Location '${{ parameters.Location }}' ` |
| 68 | + -DeleteAfterHours '${{ parameters.DeleteAfterHours }}' ` |
| 69 | + @subscriptionConfiguration ` |
| 70 | + -AdditionalParameters ${{ parameters.ArmTemplateParameters }} ` |
| 71 | + -CI ` |
| 72 | + -UseFederatedAuth ` |
| 73 | + -Force ` |
| 74 | + -Verbose | Out-Null |
| 75 | +
|
| 76 | + - ${{ else }}: |
| 77 | + - pwsh: | |
55 | 78 | eng/common/scripts/Import-AzModules.ps1 |
56 | 79 |
|
57 | 80 | $subscriptionConfiguration = @' |
|
69 | 92 | @subscriptionConfiguration ` |
70 | 93 | -AdditionalParameters ${{ parameters.ArmTemplateParameters }} ` |
71 | 94 | -CI ` |
72 | | - -FederatedAuth:$${{ parameters.UseFederatedAuth }} ` |
73 | 95 | -Force ` |
74 | 96 | -Verbose | Out-Null |
| 97 | + displayName: Deploy test resources |
| 98 | + env: |
| 99 | + TEMP: $(Agent.TempDirectory) |
0 commit comments