Azure Devops "Perform DeployFromPackage" fails due to serverless Azure SQL DB paused

We have an Azure DevOps pipeline and release configured that use "classic" (non-YAML) pipelines.  We're also using the RedGate plugins for SCA build and release/deploy (for now).  Our target DB is Azure SQL Database serverless.  Often, it is paused and needs a little time to wake up.  Unfortunately, the "Perform DeployFromPackage" task fails when the DB is paused, so we have to go in and redeploy manually.  I was unable to locate a setting that would retry the deployment or change how it handled failed SQL connections.  Any tips on how to handle this?  I'm looking at a powershell script that runs prior to the "PerformDeployFromPackage" and wakes the instance up, but that has it's own complexities.

Thank you,

-Peter
Tagged:

Best Answer

  • Sergio RSergio R Posts: 610 Rose Gold 5
    Hi Peter,

    I am afraid that the SQL Change Automation Azure Devops addons do not provide an option to reconnect if the first attempt fails.
    It looks like an Azure SQL Server Serverless database will auto-resume approximately 1 minute after triggered.
    So the way to go is to run a custom Powershell script before the SCA task.
    You can possibly use the Test-DatabaseConnection cmdlet to trigger the wakeup and put a delay of at least 60 seconds before ending the task.

    Kind Regards,
    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools

Answers

Sign In or Register to comment.