0
votes

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.

1
So, you're passing a url to a blob, as source? Remember that blobs are not an extension of a file system, and I doubt sqlpackage.exe knows how to work directly with blob storage.David Makogon
Hi @DavidMakogon . Yes i am passing url of .bacpac file store in blob. I think there must be some way around for url thing. I am still looking into it.Himanshu Mohan

1 Answers

1
votes

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://docs.microsoft.com/en-us/azure/sql-database/sql-database-import-powershell

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