Dump out correlation id without verbose logging for resource deployment (#4069)
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
This commit is contained in:
parent
bb95a22e3f
commit
4c70c2fdc6
@ -723,30 +723,28 @@ try {
|
||||
Log $msg
|
||||
|
||||
$deployment = Retry {
|
||||
$lastDebugPreference = $DebugPreference
|
||||
try {
|
||||
if ($CI) {
|
||||
$DebugPreference = 'Continue'
|
||||
}
|
||||
New-AzResourceGroupDeployment -Name $BaseName -ResourceGroupName $resourceGroup.ResourceGroupName -TemplateFile $templateFile.jsonFilePath -TemplateParameterObject $templateFileParameters -Force:$Force
|
||||
} catch {
|
||||
Write-Output @'
|
||||
#####################################################
|
||||
# For help debugging live test provisioning issues, #
|
||||
# see http://aka.ms/azsdk/engsys/live-test-help, #
|
||||
#####################################################
|
||||
'@
|
||||
throw
|
||||
} finally {
|
||||
$DebugPreference = $lastDebugPreference
|
||||
}
|
||||
New-AzResourceGroupDeployment `
|
||||
-Name $BaseName `
|
||||
-ResourceGroupName $resourceGroup.ResourceGroupName `
|
||||
-TemplateFile $templateFile.jsonFilePath `
|
||||
-TemplateParameterObject $templateFileParameters `
|
||||
-Force:$Force
|
||||
}
|
||||
|
||||
if ($deployment.ProvisioningState -eq 'Succeeded') {
|
||||
# New-AzResourceGroupDeployment would've written an error and stopped the pipeline by default anyway.
|
||||
Write-Verbose "Successfully deployed template '$($templateFile.jsonFilePath)' to resource group '$($resourceGroup.ResourceGroupName)'"
|
||||
if ($deployment.ProvisioningState -ne 'Succeeded') {
|
||||
Write-Host "Deployment '$($deployment.DeploymentName)' has state '$($deployment.ProvisioningState)' with CorrelationId '$($deployment.CorrelationId)'. Exiting..."
|
||||
Write-Host @'
|
||||
#####################################################
|
||||
# For help debugging live test provisioning issues, #
|
||||
# see http://aka.ms/azsdk/engsys/live-test-help #
|
||||
#####################################################
|
||||
'@
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Deployment '$($deployment.DeploymentName)' has CorrelationId '$($deployment.CorrelationId)'"
|
||||
Write-Host "Successfully deployed template '$($templateFile.jsonFilePath)' to resource group '$($resourceGroup.ResourceGroupName)'"
|
||||
|
||||
$deploymentOutputs = SetDeploymentOutputs $serviceName $context $deployment $templateFile
|
||||
|
||||
$postDeploymentScript = $templateFile.originalFilePath | Split-Path | Join-Path -ChildPath "$ResourceType-resources-post.ps1"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user