Import database to Azure SQL database - How to prevent error?

Martinek, Jiri 21 Reputation points
2022-05-09T14:39:01.767+00:00

I have bacpac file importable to azure by SQL management studio (tested), but I wish to use the import database functionality in Azure in SQL server blade.
Success never happens - nothing is displayed in export/import history.
Although database is created and it is blank without structure and without data.
But there is error in activity log - of course saying nothing to me :
Create Deployment fails - inside the step is this:
Operation name Performs a database extension operation.
Time stamp Mon May 09 2022 10:30:54 GMT+0200 (Central European Summer Time)

Error code InternalServerError
Message An unexpected error occured while processing the request. Tracking ID: '5bef29b3-f111-4217-821e-b9eba778552e'

There is Internal Server Error (HTTP Status Code: 500) in JSON.

Does the import work at all? What are the success conditions?
Thank you.

Azure SQL Database
{count} votes

4 answers

Sort by: Most helpful
  1. Alberto Morillo 32,886 Reputation points MVP
    2022-05-09T14:48:40.317+00:00

    Please allow me to suggest you the easiest path to migrate to Azure SQL. Use Data Migration Assistant (DMA) to perform an assessment of the database to migrate to Azure and after eradicating blocking points you can use the same tool to migrate the database without the need to deal with bacpac validations.

    Importing bacpacs you may lose a huge amount of hours but with DMA the migration journey is easier and almost no time consuming.

    0 comments No comments

  2. Martinek, Jiri 21 Reputation points
    2022-05-09T16:53:28.49+00:00

    I have used DMA for the first migration, but now I need establish regular process for dev/test team to migrate prod (SQL in Azure VM ) to test (Azure SQL database).

    Thinking the import must somehow work - or ... :)

    0 comments No comments

  3. Alberto Morillo 32,886 Reputation points MVP
    2022-05-09T17:06:53.133+00:00

    Let me know if this PowerShell script helps you automate the task successfully. If import is sucessfull using Azure PowerShell instead of the portal.

    Alternatively, you can use sqlpackage utility from the VM command line. This can later be automated using Windows scheduled tasks.

    sqlpackage.exe /a:import /tcs:"Data Source=<serverName>.database.windows.net;Initial Catalog=<migratedDatabase>;User Id=<userId>;Password=<password>" /sf:AdventureWorks2008R2.bacpac /p:DatabaseEdition=Premium /p:DatabaseServiceObjective=P6
    
    sqlpackage.exe /Action:Import /tsn:sqlsrv1.database.windows.net /tdn:worldwide /tu:morillo /tp:MySecretPwd /sf:c:\sql\WideWorldImporters-Standard.bacpac
    
    0 comments No comments

  4. Martinek, Jiri 21 Reputation points
    2022-05-10T08:24:58.517+00:00

    Still no success, but based the New-AzureRmSqlDatabaseImport - something is saying to me ... it probably doesn't support database and storage account in different subscriptions .. does it ?