Skip to content
Open
Changes from all commits
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
11 changes: 10 additions & 1 deletion vsts/E2ETestsSetup/e2eTestsSetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,16 @@ $rgExists = az group exists --name $ResourceGroup
if ($rgExists -eq "False")
{
Write-Host "`nCreating resource group $ResourceGroup in $Region"
az group create --name $ResourceGroup --location $Region --output none

# Tagged as part of the creation itself, not afterwards: the scheduled cleanup in
# Azure/azure-iot-sdk-csharp vsts/resource-group-cleanup.yaml (which deletes leftover
# 'javasdkgate*' groups as well as 'dotnetsdkgate*' ones) uses 'CreatedOn' to tell a leftover
# group from one whose gate run is still in flight. Tagging in a second, separate call would
# leave a window where a run that dies in between produces an untagged group. That cleanup
# still reclaims such a group, but only via the slower 24-hour first-observed fallback rather
# than the 3-hour path. A single tag is passed here on purpose -- under the AzureCLI@2 task,
# '--tags' with several key=value arguments collapses them into one tag value.
az group create --name $ResourceGroup --location $Region --tags "CreatedOn=$([datetime]::UtcNow.ToString('o'))" --output none
}

$resourceGroupId = az group show -n $ResourceGroup --query id --out tsv
Expand Down