1
votes

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.

I have the following as seen in the picture:

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

And this is where I must add the task for 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.

1
The point is Azure SQL database doesn't support restore from .bak file, the pipeline couldn't work.Leon Yue
Azure SQL Database does not currently support restoring from a .bak file. If you can get the database backup as a .bacpac instead of .bak, you should be able to restore it from Azure DevOps pipeline.Kalyan Chanumolu-MSFT
1. Having the backup .bacpac, what task can I use for the restoration? 2. Is it possible to restore that .bak in an azure virtual machine resource?jhoanna
@jhoanna Have you checked the following reply? Is it helpful?Cece Dong - MSFT

1 Answers

0
votes

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