-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathset-azure-connection-variables.ps1
53 lines (53 loc) · 1.9 KB
/
set-azure-connection-variables.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string] $EnvironmentName,
[string] $SubscriptionId,
[switch] $AsHashtable
)
process {
$vars = switch ($EnvironmentName) {
({ ($PSItem -in 'dev', 'qa', 'rel', 'release') -or ($PSItem -like 'demo*') }) {
@{
# cli-devops-shared-web-api-starter-arm
clientId = 'e18be585-830e-408d-bafa-fe4d41a5e52e'
tenantId = '77806292-ec65-4665-8395-93cb7c9dbd36'
subscriptionId = '402f88b4-9dd2-49e3-9989-96c788e93372'
}
}
({$PSItem -in 'staging', 'prod-na', 'prod'}) {
@{
# cli-nadevopsproduction-prod-web-api-starter-arm
clientId = '6a3a29da-76bf-4ee2-b2fc-a65ccf22f33e'
tenantId = '77806292-ec65-4665-8395-93cb7c9dbd36'
subscriptionId = '402f88b4-9dd2-49e3-9989-96c788e93372'
}
}
'prod-emea' {
@{
# cli-emeadevopsproduction-prod-web-api-starter-arm
clientId = '3d7a904f-568d-4dbf-abbd-2b8edd4f2ce6'
tenantId = '77806292-ec65-4665-8395-93cb7c9dbd36'
subscriptionId = '402f88b4-9dd2-49e3-9989-96c788e93372'
}
}
'prod-apac' {
@{
# cli-apacdevopsproduction-prod-web-api-starter-arm
clientId = 'beec650e-3408-4191-8e63-7098190a2e7b'
tenantId = '77806292-ec65-4665-8395-93cb7c9dbd36'
subscriptionId = '402f88b4-9dd2-49e3-9989-96c788e93372'
}
}
}
if ($SubscriptionId) {
$vars.subscriptionId = $SubscriptionId
}
if ($AsHashtable) {
$vars
} else {
$vars.Keys | ForEach-Object {
('{0}={1}' -f $_, $vars[$_]) >> $env:GITHUB_OUTPUT
}
}
}