Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dogfood cloud #1032

Merged
merged 8 commits into from
Sep 30, 2020
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