Skip to content

Commit

Permalink
Fix update test resources tagging when tags are empty. Bump max limit (
Browse files Browse the repository at this point in the history
…Azure#39409)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
  • Loading branch information
2 people authored and matthohn-msft committed Oct 27, 2023
1 parent 8ba7676 commit 470b9a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion eng/common/TestResources/Update-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ param (
[string] $SubscriptionId,

[Parameter()]
[ValidateRange(1, 7*24)]
[ValidateRange(1, 30*24)]
[int] $DeleteAfterHours = 48
)

Expand Down Expand Up @@ -136,6 +136,9 @@ try {

Log "Updating DeleteAfter to '$deleteAfter'"
Write-Warning "Any clean-up scripts running against subscription '$SubscriptionId' may delete resource group '$ResourceGroupName' after $DeleteAfterHours hours."
if (!$resourceGroup.Tags) {
$resourceGroup.Tags = @{}
}
$resourceGroup.Tags['DeleteAfter'] = $deleteAfter

Log "Updating resource group '$ResourceGroupName'"
Expand Down

0 comments on commit 470b9a2

Please sign in to comment.