Skip to content

Commit f5fa3a4

Browse files
authored
Sync eng/common directory with azure-sdk-tools repository for Tools PR 1032 (Azure#15412)
1 parent ed8deaf commit f5fa3a4

File tree

5 files changed

+42
-5
lines changed

5 files changed

+42
-5
lines changed

eng/common/TestResources/New-TestResources.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ param (
5555
[string] $Location = '',
5656

5757
[Parameter()]
58-
[ValidateSet('AzureCloud', 'AzureUSGovernment', 'AzureChinaCloud')]
58+
[ValidateSet('AzureCloud', 'AzureUSGovernment', 'AzureChinaCloud', 'Dogfood')]
5959
[string] $Environment = 'AzureCloud',
6060

6161
[Parameter()]
@@ -141,6 +141,7 @@ if (!$Location) {
141141
'AzureCloud' = 'westus2';
142142
'AzureUSGovernment' = 'usgovvirginia';
143143
'AzureChinaCloud' = 'chinaeast2';
144+
'Dogfood' = 'westus'
144145
}[$Environment]
145146

146147
Write-Verbose "Location was not set. Using default location for environment: '$Location'"
@@ -512,6 +513,7 @@ is based on the cloud to which the template is being deployed:
512513
* AzureCloud -> 'westus2'
513514
* AzureUSGovernment -> 'usgovvirginia'
514515
* AzureChinaCloud -> 'chinaeast2'
516+
* Dogfood -> 'westus'
515517
516518
.PARAMETER Environment
517519
Name of the cloud environment. The default is the Azure Public Cloud

eng/common/TestResources/New-TestResources.ps1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ is based on the cloud to which the template is being deployed:
322322
* AzureCloud -\> 'westus2'
323323
* AzureUSGovernment -\> 'usgovvirginia'
324324
* AzureChinaCloud -\> 'chinaeast2'
325+
* Dogfood -\> 'westus'
325326
326327
```yaml
327328
Type: String

eng/common/TestResources/Remove-TestResources.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ param (
4343
[string] $ServiceDirectory,
4444

4545
[Parameter()]
46-
[ValidateSet('AzureCloud', 'AzureUSGovernment', 'AzureChinaCloud')]
46+
[ValidateSet('AzureCloud', 'AzureUSGovernment', 'AzureChinaCloud', 'Dogfood')]
4747
[string] $Environment = 'AzureCloud',
4848

4949
[Parameter()]

eng/common/TestResources/deploy-test-resources.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ parameters:
1818
# }
1919

2020
steps:
21-
# New-TestResources command requires Az module
22-
- pwsh: Install-Module -Name Az -Scope CurrentUser -AllowClobber -Force -Verbose
23-
displayName: Install Azure PowerShell module
21+
- template: /eng/common/TestResources/setup-az-modules.yml
2422

2523
- pwsh: |
2624
$subscriptionConfiguration = @"
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Cloud Configuration will be splat into parameters of `Add-AzEnvironment`. It
2+
# should be JSON in the form (not all fields are required):
3+
# {
4+
# "Name": "<environment name>",
5+
# "PublishSettingsFileUrl": "<publish settings file url>",
6+
# "ServiceEndpoint": "<service endpoint>",
7+
# "ManagementPortalUrl": "<management portal url>",
8+
# "ActiveDirectoryEndpoint": "<active directory endpoint>",
9+
# "ActiveDirectoryServiceEndpointResourceId": "<active directory service endpoint resource id>",
10+
# "ResourceManagerEndpoint": "<resource manager endpoint>",
11+
# "GalleryEndpoint": "<gallery endpoint>",
12+
# "GraphEndpoint": "<graph endpoint>",
13+
# "GraphAudience": "<graph audience>",
14+
# "AzureKeyVaultDnsSuffix": "<key vault suffix>",
15+
# "AzureKeyVaultServiceEndpointResourceId": "<key vault service endpoint resource id>"
16+
# }
17+
18+
steps:
19+
- bash: sudo chown -R runner ~/.Azure
20+
displayName: (MacOS) Grant access to ~/.Azure
21+
condition: contains(variables['OSVmImage'], 'mac')
22+
23+
# New-TestResources command requires Az module
24+
- pwsh: Install-Module -Name Az -Scope CurrentUser -AllowClobber -Force -Verbose
25+
displayName: Install Azure PowerShell module
26+
27+
- task: Powershell@2
28+
inputs:
29+
displayName: Register Dogfood environment
30+
targetType: inline
31+
pwsh: true
32+
script: |
33+
$environmentSpec = @"
34+
$(env-config-dogfood)
35+
"@ | ConvertFrom-Json -AsHashtable;
36+
Add-AzEnvironment @environmentSpec

0 commit comments

Comments
 (0)