Greetings!
Welcome to Microsoft Q&A forum.
Please make sure to pass correct username and password in the powershll script
You can use below powershell script to export the database
$exportRequest = New-AzSqlDatabaseExport -ResourceGroupName $ResourceGroupName -ServerName $ServerName -DatabaseName $DatabaseName -StorageKeytype $StorageKeytype -StorageKey $StorageKey -StorageUri $BacpacUri -AdministratorLogin $creds.UserName -AdministratorLoginPassword $creds.Password
To check the status of the export request, use the Get-AzSqlDatabaseImportExportStatus cmdlet. Running this cmdlet immediately after the request usually returns Status: InProgress. When you see Status: Succeeded the export is complete.
Sample script:
$exportStatus = Get-AzSqlDatabaseImportExportStatus -OperationStatusLink $exportRequest.OperationStatusLink
[Console]::Write("Exporting")
while ($exportStatus.Status -eq "InProgress")
{
`` Start-Sleep -s 10
`` $exportStatus = Get-AzSqlDatabaseImportExportStatus -OperationStatusLink $exportRequest.OperationStatusLink
`` [Console]::Write(".")
}
[Console]::WriteLine("")
$exportStatus
Here are certain limitations while exporting the db:
- Exporting a BACPAC file to Azure premium storage using the methods discussed in this article isn't supported.
- Storage behind a firewall is currently not supported.Immutable storage is currently not supported.
- Currently, the Import/Export service does not support Microsoft Entra ID authentication when MFA is required.
- Import\Export services only support SQL authentication and Microsoft Entra ID.
- Import\Export is not compatible with Microsoft Identity application registration.
Thank You!