Skip to content

Commit

Permalink
Add support for dogfood cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljurek committed Sep 21, 2020
1 parent c449bc1 commit cc0acd3
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 7 deletions.
1 change: 0 additions & 1 deletion eng/common/TestResources/New-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ param (
[string] $Location = '',

[Parameter()]
[ValidateSet('AzureCloud', 'AzureUSGovernment', 'AzureChinaCloud')]
[string] $Environment = 'AzureCloud',

[Parameter()]
Expand Down
1 change: 0 additions & 1 deletion eng/common/TestResources/Remove-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ param (
[string] $ServiceDirectory,

[Parameter()]
[ValidateSet('AzureCloud', 'AzureUSGovernment', 'AzureChinaCloud')]
[string] $Environment = 'AzureCloud',

[Parameter()]
Expand Down
8 changes: 3 additions & 5 deletions eng/common/TestResources/deploy-test-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ parameters:
# "TenantId": "<tenant id>",
# "TestApplicationId": "<test app id>",
# "TestApplicationSecret": "<test app secret>",
# "ProvisionerApplicationId": "<provisioner app id>",
# "ProvisionerApplicationSecret": "<provisioner app secret>",
# "ProvisionerApplicationId": "<provisoner app id>",
# "ProvisoinerApplicationSecret": "<provisoner app secert>",
# "Environment": "AzureCloud | AzureGov | AzureChina | <other environment>"
# }

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

- pwsh: |
$subscriptionConfiguration = @"
Expand Down
36 changes: 36 additions & 0 deletions eng/common/TestResources/setup-az-modules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Cloud Configuration will be splat into parameters of `Add-AzEnvironment`. It
# should be JSON in the form (not all fields are required):
# {
# "Name": "<environment name>",
# "PublishSettingsFileUrl": "<publish settings file url>",
# "ServiceEndpoint": "<service endpoint>",
# "ManagementPortalUrl": "<management portal url>",
# "ActiveDirectoryEndpoint": "<active directory endpoint>",
# "ActiveDirectoryServiceEndpointResourceId": "<active directory service endpoint resource id>",
# "ResourceManagerEndpoint": "<resource manager endpoint>",
# "GalleryEndpoint": "<gallery endpoint>",
# "GraphEndpoint": "<graph endpoint>",
# "GraphAudience": "<graph audience>",
# "AzureKeyVaultDnsSuffix": "<key vault suffix>",
# "AzureKeyVaultServiceEndpointResourceId": "<key vault service endpoint resource id>"
# }

steps:
- bash: sudo chown -R runner ~/.Azure
displayName: (MacOS) Grant access to ~/.Azure
condition: contains(variables['OSVmImage'], 'mac')

# New-TestResources command requires Az module
- pwsh: Install-Module -Name Az -Scope CurrentUser -AllowClobber -Force -Verbose
displayName: Install Azure PowerShell module

- task: Powershell@2
inputs:
displayName: Register Dogfood environment
targetType: inline
pwsh: true
script: |
$environmentSpec = @"
$(env-config-dogfood)
"@ | ConvertFrom-Json -AsHashtable;
Add-AzEnvironment @environmentSpec

0 comments on commit cc0acd3

Please sign in to comment.