@@ -723,29 +723,27 @@ try {
723
723
Log $msg
724
724
725
725
$deployment = Retry {
726
- $lastDebugPreference = $DebugPreference
727
- try {
728
- if ($CI ) {
729
- $DebugPreference = ' Continue'
730
- }
731
- New-AzResourceGroupDeployment - Name $BaseName - ResourceGroupName $resourceGroup.ResourceGroupName - TemplateFile $templateFile.jsonFilePath - TemplateParameterObject $templateFileParameters - Force:$Force
732
- } catch {
733
- Write-Output @'
726
+ New-AzResourceGroupDeployment `
727
+ - Name $BaseName `
728
+ - ResourceGroupName $resourceGroup.ResourceGroupName `
729
+ - TemplateFile $templateFile.jsonFilePath `
730
+ - TemplateParameterObject $templateFileParameters `
731
+ - Force:$Force
732
+ }
733
+
734
+ if ($deployment.ProvisioningState -ne ' Succeeded' ) {
735
+ Write-Host " Deployment '$ ( $deployment.DeploymentName ) ' has state '$ ( $deployment.ProvisioningState ) ' with CorrelationId '$ ( $deployment.CorrelationId ) '. Exiting..."
736
+ Write-Host @'
734
737
#####################################################
735
738
# For help debugging live test provisioning issues, #
736
- # see http://aka.ms/azsdk/engsys/live-test-help, #
739
+ # see http://aka.ms/azsdk/engsys/live-test-help #
737
740
#####################################################
738
741
'@
739
- throw
740
- } finally {
741
- $DebugPreference = $lastDebugPreference
742
- }
742
+ exit 1
743
743
}
744
744
745
- if ($deployment.ProvisioningState -eq ' Succeeded' ) {
746
- # New-AzResourceGroupDeployment would've written an error and stopped the pipeline by default anyway.
747
- Write-Verbose " Successfully deployed template '$ ( $templateFile.jsonFilePath ) ' to resource group '$ ( $resourceGroup.ResourceGroupName ) '"
748
- }
745
+ Write-Host " Deployment '$ ( $deployment.DeploymentName ) ' has CorrelationId '$ ( $deployment.CorrelationId ) '"
746
+ Write-Host " Successfully deployed template '$ ( $templateFile.jsonFilePath ) ' to resource group '$ ( $resourceGroup.ResourceGroupName ) '"
749
747
750
748
$deploymentOutputs = SetDeploymentOutputs $serviceName $context $deployment $templateFile
751
749
0 commit comments