How can i restore a database in Azure SQL from storage account throught Script

Alex Pereira 21 Reputation points
2020-07-17T20:29:09.86+00:00

Hello friends,
i have a blob storage account in azure with a .bacpac file and i would like to restore this database to azure sql database using a script, since the user that will do the restore dont have access to Azure Portal.

Can somebody help me to achieve this?

Azure SQL Database
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,512 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ronen Ariely 15,096 Reputation points
    2020-07-17T23:23:51.377+00:00

    Good day @AlexPereira-0125 ,

    i would like to restore this database to azure sql database

    I am sorry but you cannot use bacpac to restore a database since backpac does not include the information for restoring. A bacpac file is NOT a Disaster Recovery solution and should not use for such task!

    On July 14, I lectured about "The Internals Of The External SQLpackage Tool-Inside A Bacpac File" at the "lightup 2020 conference". The session was recorded but the recording are not yet available (I think). You really MUST listen to the recording as soon as you can!

    If we ignore the word "restore" and replace it with the world copy the database then:

    Azure SQL Server allows one "Server admin" administrative account and Active Directory admins that act as administrators.

    You can use one of these administrator accounts to connect from any application that you develop to the Azure SQL Server. In the application you can execute the import command.

    You can develop a local application and use the SqlPackage command tool for the task. According to yhr language you use you can execute command tools.

    You can also use Azure Function for the task as describe here:
    https://stackoverflow.com/questions/51477519/azure-function-import-bacpac-file-from-blob-storage-in-azure-sql-server-aad

    0 comments No comments

0 additional answers

Sort by: Most helpful