简体   繁体   中英

Azure DevOps - Pipeline Release Task to Restore Database

Is there a task in the Release Pipelines of Azure DevOps (either created by Microsoft or 3rd party) that would be able to connect to my database and execute a stored procedure I have that will restore my database?

Currently, I have to remote desktop into my virtual machine that houses my SQL Server 2019 database and execute my restore script. What I'd like to do is have a task that will access my database in my VM and restore it for me, but I'm not sure how I would go about doing that or even if that functionality exists.

Currently there are no available pre-defined tasks to execute sql script in SQL Server database in Azure pipelines.

As a workaround, you could try to deploy self-hosted agent on your VM, and then use this agent in release pipeline, so the release will run on your VM. And you could run your sql script using the Command Line task or PowerShell task . See: Custom Azure DevOps pipeline task to execute a SQL script for more details.

BTW, we find this 3rd-party extension: SQLplus Executer - Release Edition , which can execute sql-files using SQLplus. You might check it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM