Fix update test resources tagging when tags are empty. Bump max limit (#5048)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
This commit is contained in:
Azure SDK Bot 2023-10-19 15:58:56 -07:00 committed by GitHub
parent 860240fec9
commit 21978a69d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,7 @@ param (
[string] $SubscriptionId,
[Parameter()]
[ValidateRange(1, 7*24)]
[ValidateRange(1, 30*24)]
[int] $DeleteAfterHours = 48
)
@ -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'"