Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add TME to clean-up
  • Loading branch information
weshaggard committed Oct 8, 2024
commit 1c140be5edbd26c482f9092d58bef476e055c8e3
13 changes: 13 additions & 0 deletions eng/pipelines/live-test-cleanup-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ steps:
$(SubscriptionConfiguration)
'@ | ConvertFrom-Json -AsHashtable

$context = Get-AzContext
$subscriptionConfiguration["Environment"] = $context.Environment.Name
$subscriptionConfiguration["SubscriptionId"] = $context.Subscription.Id
$subscriptionConfiguration["TenantId"] = $context.Subscription.TenantId
$subscriptionConfiguration["TestApplicationId"] = $context.Account.Id
$subscriptionConfiguration["ProvisionerApplicationId"] = $context.Account.Id

$principal = Get-AzADServicePrincipal -ApplicationId $context.Account.Id
$subscriptionConfiguration["TestApplicationOid"] = $principal.Id
$subscriptionConfiguration["ProvisionerApplicationOid"] = $principal.Id

Write-Host ($subscriptionConfiguration | ConvertTo-Json)

./eng/scripts/live-test-resource-cleanup.ps1 `
-OpensourceApiApplicationToken $(opensource-api-token) `
-GithubAliasCachePath ${{ parameters.GithubAliasCachePath }} `
Expand Down
22 changes: 5 additions & 17 deletions eng/pipelines/live-test-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,22 @@ parameters:
- name: Subscriptions
type: object
default:
- DisplayName: AzureCloud TME - Resource Cleanup
ServiceConnection: azure-sdk-tests-public
AdditionalParameters: "-DeleteNonCompliantGroups -DeleteArmDeployments"
- DisplayName: AzureCloud - Resource Cleanup
ServiceConnection: azure-sdk-tests
SubscriptionConfigurationFilePaths:
- eng/common/TestResources/sub-config/AzurePublicMsft.json
AdditionalParameters: "-DeleteNonCompliantGroups -DeleteArmDeployments"
- DisplayName: AzureCloud-Preview - Resource Cleanup
ServiceConnection: azure-sdk-tests-preview
SubscriptionConfigurationFilePaths:
- eng/common/TestResources/sub-config/AzurePreviewMsft.json
AdditionalParameters: "-DeleteArmDeployments"
# TODO: Enable strict resource cleanup after pre-existing static groups have been handled
# AdditionalParameters: "-DeleteNonCompliantGroups"
- DisplayName: AzureUSGovernment - Resource Cleanup
ServiceConnection: usgov_azure-sdk-tests
SubscriptionConfigurationFilePaths:
- eng/common/TestResources/sub-config/AzureUsGovMsft.json
ServiceConnection: azure-sdk-tests-usgov
# TODO: Enable strict resource cleanup after pre-existing static groups have been handled
# AdditionalParameters: "-DeleteNonCompliantGroups"
- DisplayName: AzureChinaCloud - Resource Cleanup
ServiceConnection: china_azure-sdk-tests
SubscriptionConfigurationFilePaths:
- eng/common/TestResources/sub-config/AzureChinaMsft.json
ServiceConnection: azure-sdk-tests-china
# TODO: Enable strict resource cleanup after pre-existing static groups have been handled
# AdditionalParameters: "-DeleteNonCompliantGroups"
- DisplayName: AzureCloud Playground - Resource Cleanup
ServiceConnection: azure-sdk-tests-playground
SubscriptionConfigurations:
- $(sub-config-azure-cloud-playground)
AdditionalParameters: "-DeleteNonCompliantGroups -DeleteArmDeployments -MaxLifespanDeleteAfterHours 240"
# TODO: Disabled this clean-up as the dogfood enviroment is busted and the tests are no longer running
# see https://github.com/Azure/azure-sdk-for-python/pull/33483 were the tests were disabled.
Expand Down