Skip to content

Error on MSSQL server deployment exits cli with exit code 0, and doesn't stop the pipeline. #21066

@rbalchev

Description

@rbalchev

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug
I'm using AzureCLi on Azure pipelines.
I have auto-pausing SQL server. When the server is sleeping, azcli tool fails with:
ERROR: {"status":"Failed","error":{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"Conflict","message":"{\r\n "status": "Failed",\r\n "error": {\r\n "code": "ResourceDeploymentFailure",\r\n "message": "The resource operation completed with terminal provisioning state 'Failed'.",\r\n "details": [\r\n {\r\n "code": "ConflictingDatabaseOperation",\r\n "message": "Operation on server 'mssql-andromeda-test-southcentralus' and database 'dbsync-andromeda-test-southcentralus' is in progress. Please wait a few minutes before trying again."\r\n }\r\n ]\r\n }\r\n}"}]}}

However, it exists with successful error code, and doesn't stop the bash pipeline execution.

To Reproduce

Expected behavior
azure cli should exit with non zero error code, in case if there is an error,

Environment summary
Ubuntu-latest in Azure devops.

Additional context
az deployment group create
--name sqldbs-rollout-$(Build.SourceVersion)
--resource-group data-${{variables.project}}-${{variables.envoriment_name}}-${{variables.location}}
--template-file $(Build.SourcesDirectory)/az.resources/data/base/sql-databases-base.json
--parameters ./tmp/sql-databases-${{variables.envoriment_name}}.json

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions