From 4f8eca93fd87a9764e81ddbc694488fc7c485f06 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 16 Oct 2023 17:00:14 -0700 Subject: [PATCH] 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 * Apply suggestions from code review --------- Co-authored-by: Ben Broderick Phillips Co-authored-by: Heath Stewart --- eng/common/TestResources/New-TestResources.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eng/common/TestResources/New-TestResources.ps1 b/eng/common/TestResources/New-TestResources.ps1 index 49616b64b..9d940e723 100644 --- a/eng/common/TestResources/New-TestResources.ps1 +++ b/eng/common/TestResources/New-TestResources.ps1 @@ -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 {