SQLPACKAGE.exe with Source file is on Azure Blob storage

Nguyen, Hoa 331 Reputation points
2022-09-03T01:38:24.08+00:00

Hello,
I am running sqlpackage.exe /Action:Import.
The intent is to use a bacpac file in Azure Blob container and import it into an azure sql database.

I do not know how to code the source file. Please help and advise.

C:\Program Files\Microsoft SQL Server\160\DAC\bin>sqlpackage.exe /Action:Import /sf:mycontainer.blob.core.windows.net\legacysqltestdbbackups\sqltestDBSep2.bacpac /tsn:sandboxarchive.database.windows.net /tdn:sqltestdbsep2 /tu:xxxxxadmin /tp:xxxxxx
Importing to database 'sqltestdbsep2' on server 'sandboxarchiveinventory.database.windows.net'.
*** Error importing database:Could not load package from 'myblobcontainer.blob.core.windows.net\legacysqltestdbbackups\sqltestDBSep2.bacpac'.
Could not find a part of the path 'C:\Program Files\Microsoft SQL Server\160\DAC\bin\absgsandboxblobcontainer.blob.core.windows.net\legacysqltestdbbackups\sqltestDBSep2.bacpac'.

Thank you!

Azure SQL Database
{count} votes

2 answers

Sort by: Most helpful
  1. Oury Ba-MSFT 16,076 Reputation points Microsoft Employee
    2022-09-15T17:41:03.753+00:00

    Hi @Nguyen, Hoa Thank you for posting your question on Microsoft Q&A and for using Azure services.

    As per my understanding, you are getting an error while trying to import a bacpac file from Azure Blob container into an Azure SQL database. Please let me know if my understanding is incorrect. The error message you shared above seems to be related to a missing http:// or https:// in front of absgandbox...
    Could you please modify the path again and let us know if that fixed the problem.

    Regards,
    Oury


  2. Nguyen, Hoa 331 Reputation points
    2022-09-19T19:20:00.133+00:00

    Oury,
    Sorry for the delay.
    I got a chance to code with https as below and sadly, it did not work. The syntax /sf:https://xxxxsandboxblobcontainer.blob.core.windows.net/legacysqltestdbbackups/SQLTestDB.bacpac DOES NOT LOOK RIGHT!

    C:\WINDOWS\system32>cd C:\Program Files\Microsoft SQL Server\160\DAC\bin

    C:\Program Files\Microsoft SQL Server\160\DAC\bin>sqlpackage.exe /Action:Import /sf:https://xxxxsandboxblobcontainer.blob.core.windows.net/legacysqltestdbbackups/SQLTestDB.bacpac /tsn:sandboxarchive.database.windows.net /tdn:sqltestdb /tu:xxxadmin /tp:xx
    Importing to database 'sqltestdb' on server 'sandboxarchive.database.windows.net'.
    *** Error importing database:Could not load package from 'https://absgsandboxblobcontainer.blob.core.windows.net/legacysqltestdbbackups/SQLTestDB.bacpac'.
    The given path's format is not supported.
    Time elapsed 0:00:01.09

    C:\Program Files\Microsoft SQL Server\160\DAC\bin>

    Thank you for the help!