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 useSQLPACKAGE
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