Sync eng/common directory with azure-sdk-tools for PR 7113 (#5032)

* Remove ARM deployment after deploy

* Update eng/common/TestResources/New-TestResources.ps1

Co-authored-by: Heath Stewart <heaths@outlook.com>

* Apply suggestions from code review

---------

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
Co-authored-by: Heath Stewart <heaths@outlook.com>
This commit is contained in:
Azure SDK Bot 2023-10-16 17:00:14 -07:00 committed by GitHub
parent 81d1143a43
commit 4f8eca93fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -771,7 +771,6 @@ try {
-TemplateParameterObject $templateFileParameters `
-Force:$Force
}
if ($deployment.ProvisioningState -ne 'Succeeded') {
Write-Host "Deployment '$($deployment.DeploymentName)' has state '$($deployment.ProvisioningState)' with CorrelationId '$($deployment.CorrelationId)'. Exiting..."
Write-Host @'
@ -803,6 +802,9 @@ try {
Write-Verbose "Removing compiled bicep file $($templateFile.jsonFilePath)"
Remove-Item $templateFile.jsonFilePath
}
Write-Host "Deleting ARM deployment as it may contain secrets. Deployed resources will not be affected."
$null = $deployment | Remove-AzResourceGroupDeployment
}
} finally {