Himanshu Mohan
Himanshu Mohan

Reputation: 732

Upload SQL Database from Azure Blob Azure to Sql Database

I want to transfer .bacpac database from Azure Blob Storage to Azure SQL Database. I am using sqlpackage.exe using import command as

sqlpackage.exe /a:Import /sf:< Azure Blob .bacpac file > /tsn:< Azure Server Name > /tdn:< target databse name > /tu:< target database user name > /tp:< target database password >

But this command giving error as

"Could not load package from . File format not supported".

Please note while giving local file(.bacpac file in same system as sqlpackage)in /sf field, it works fine.

---Edit---

More detail: I want to upload .bacpac file into Azure DB using nodejs code. So the only option I came up is upload user's .bacpac file to Azure blob and then call a custom script containing sqlpackage.exe command in configured azure Windows Server to transfer this uploaded bacpac to Azure DB. It would be helpful if you can provide any feasible solution for this scenario other than I figured out.

Upvotes: 0

Views: 2028

Answers (1)

Ian
Ian

Reputation: 249

Hi this can be done via the portal or via PowerShell is there a specific need to use sqlpackage.exe?

PowerShell instructions are available at: https://learn.microsoft.com/en-us/azure/sql-database/sql-database-import-powershell

Portal at: https://learn.microsoft.com/en-us/azure/sql-database/sql-database-import-portal

Upvotes: 1

Related Questions