1
- # Deploys resources to a cloud type specified by the variable (not parameter)
2
- # 'CloudType'. Use this as part of a matrix to deploy resources to a particular
3
- # cloud instance. Normally we would use template parameters instead of variables
4
- # but matrix variables are not available during template expansion so any
5
- # benefits of parameters are lost.
6
-
7
1
parameters :
8
2
ServiceDirectory : not-set
9
3
ArmTemplateParameters : ' @{}'
10
4
DeleteAfterHours : 24
11
5
Location : ' '
6
+ SubscriptionConfiguration : $(sub-config-azure-cloud-test-resources)
7
+
8
+ # SubscriptionConfiguration will be splat into the parameters of the test
9
+ # resources script. It should be JSON in the form:
10
+ # {
11
+ # "SubscriptionId": "<subscription id>",
12
+ # "TenantId": "<tenant id>",
13
+ # "TestApplicationId": "<test app id>",
14
+ # "TestApplicationSecret": "<test app secret>",
15
+ # "ProvisionerApplicationId": "<provisoner app id>",
16
+ # "ProvisoinerApplicationSecret": "<provisoner app secert>",
17
+ # "Environment": "AzureCloud | AzureGov | AzureChina | <other environment>"
18
+ # }
12
19
13
20
steps :
14
21
# New-TestResources command requires Az module
15
22
- pwsh : Install-Module -Name Az -Scope CurrentUser -AllowClobber -Force -Verbose
16
23
displayName : Install Azure PowerShell module
17
24
18
- - pwsh : >
19
- eng/common/TestResources/New-TestResources.ps1
20
- -BaseName 'Generated'
21
- -ServiceDirectory '${{ parameters.ServiceDirectory }}'
22
- -TenantId '$(aad-azure-sdk-test-tenant-id)'
23
- -SubscriptionId '$(azure-subscription-id)'
24
- -TestApplicationId '$(aad-azure-sdk-test-client-id)'
25
- -TestApplicationSecret '$(aad-azure-sdk-test-client-secret)'
26
- -ProvisionerApplicationId '$(aad-azure-sdk-test-client-id)'
27
- -ProvisionerApplicationSecret '$(aad-azure-sdk-test-client-secret)'
28
- -AdditionalParameters ${{ parameters.ArmTemplateParameters }}
29
- -DeleteAfterHours ${{ parameters.DeleteAfterHours }}
30
- -Location '${{ parameters.Location }}'
31
- -Environment 'AzureCloud'
32
- -CI
33
- -Force
34
- -Verbose
35
- displayName: Deploy test resources (AzureCloud)
36
- condition: and(succeeded(), eq(variables['CloudType'], 'AzureCloud'))
37
-
38
- - pwsh : >
39
- eng/common/TestResources/New-TestResources.ps1
40
- -BaseName 'Generated'
41
- -ServiceDirectory '${{ parameters.ServiceDirectory }}'
42
- -TenantId '$(aad-azure-sdk-test-tenant-id-gov)'
43
- -SubscriptionId '$(azure-subscription-id-gov)'
44
- -TestApplicationId '$(aad-azure-sdk-test-client-id-gov)'
45
- -TestApplicationSecret '$(aad-azure-sdk-test-client-secret-gov)'
46
- -ProvisionerApplicationId '$(aad-azure-sdk-test-client-id-gov)'
47
- -ProvisionerApplicationSecret '$(aad-azure-sdk-test-client-secret-gov)'
48
- -AdditionalParameters ${{ parameters.ArmTemplateParameters }}
49
- -DeleteAfterHours ${{ parameters.DeleteAfterHours }}
50
- -Location '${{ parameters.Location }}'
51
- -Environment 'AzureUSGovernment'
52
- -CI
53
- -Force
54
- -Verbose
55
- displayName: Deploy test resources (AzureUSGovernment)
56
- condition: and(succeeded(), eq(variables['CloudType'], 'AzureUSGovernment'))
25
+ - pwsh : |
26
+ $subscriptionConfiguration = @"
27
+ ${{ parameters.SubscriptionConfiguration }}
28
+ "@ | ConvertFrom-Json -AsHashtable;
57
29
58
- - pwsh : >
59
- eng/common/TestResources/New-TestResources.ps1
60
- -BaseName 'Generated'
61
- -ServiceDirectory '${{ parameters.ServiceDirectory }}'
62
- -TenantId '$(aad-azure-sdk-test-tenant-id-cn)'
63
- -SubscriptionId '$(azure-subscription-id-cn)'
64
- -TestApplicationId '$(aad-azure-sdk-test-client-id-cn)'
65
- -TestApplicationSecret '$(aad-azure-sdk-test-client-secret-cn)'
66
- -ProvisionerApplicationId '$(aad-azure-sdk-test-client-id-cn)'
67
- -ProvisionerApplicationSecret '$(aad-azure-sdk-test-client-secret-cn)'
68
- -AdditionalParameters ${{ parameters.ArmTemplateParameters }}
69
- -DeleteAfterHours ${{ parameters.DeleteAfterHours }}
70
- -Location '${{ parameters.Location }}'
71
- -Environment 'AzureChinaCloud'
72
- -CI
73
- -Force
74
- -Verbose
75
- displayName: Deploy test resources (AzureChinaCloud)
76
- condition: and(succeeded(), eq(variables['CloudType'], 'AzureChinaCloud'))
30
+ eng/common/TestResources/New-TestResources.ps1 `
31
+ -BaseName 'Generated' `
32
+ -ServiceDirectory ${{ parameters.ServiceDirectory }} `
33
+ -Location '${{ parameters.Location }}' `
34
+ -DeleteAfterHours ${{ parameters.DeleteAfterHours }} `
35
+ -AdditionalParameters ${{ parameters.ArmTemplateParameters }} `
36
+ @subscriptionConfiguration `
37
+ -CI `
38
+ -Force `
39
+ -Verbose
40
+ displayName: Deploy test resources
0 commit comments