简体   繁体   中英

it is possible by means of a pipeline of Microsoft devops to restore a backup .bak in a resource of SQL Server in Microsoft Azure?

The backup .bak is hosted on a storage account. I need to perform an automatic restore through an Azure Devops pipeline on a Microsoft Azure SQL Server resource.

如图所示,我有以下内容:

And this is where I must add the task for the automatic restore.

这是我必须添加自动恢复任务的地方

What task should i be using to do the automatic restore

Or if you know in another way how to do the restoration it also works for me.

To import BACPAC file you may use SqlAzureDacpacDeployment@1 and if you want to restore database hosted on VM you may use SQLPACKAGE which is installed on Windows based MS Hosted agents. Please check this link too. To find SQL Package you may use this script . You may also consider using FAKE tool and theirs SQL Package wrapper . Here you have my blog post about this.

If you have your DACPAC file on storage account you have to download it first, but for this you may use AzureCliTask and az storage file copy

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