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.