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

There are 1 answers

2
Krzysztof Madej On

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