New-AzSqlDatabaseExport give no error, but never create bacpac file

Viewed 49

I would like to export Azure SQL database as file to Storage. There is only table with one row for testing purpose.

I execute followings and it does not give any errors, but it never created bacpac file to Storage. Re-executing commands gives "There is an import or export operation in progress on the database" so obviously it has tried something.

What could be wrong?

New-AzSqlDatabaseExport -ResourceGroupName "RG01" -ServerName "Server01" -DatabaseName 
"Database01" -StorageKeyType "StorageAccessKey" -StorageKey "StorageKey01" -StorageUri 
"http://account01.blob.core.contoso.net/bacpacs/database01.bacpac" -AdministratorLogin "User" 
-AdministratorLoginPassword "secure password"

https://docs.microsoft.com/en-us/powershell/module/az.sql/new-azsqldatabaseexport?view=azps-8.3.0

1 Answers

With the below cmdlets taken from the same MS Doc provided,

$SecurePassword  =  ConvertTo-SecureString  -String  "userkrishna56"  -AsPlainText  -Force  
New-AzSqlDatabaseExport -ResourceGroupName "HariTestRG" -ServerName "ksqldbserver01" -DatabaseName "ksqldb01" -StorageKeyType "StorageAccessKey" -StorageKey "<storageaccount_accesskey>" -StorageUri "https://krishpsfunasp.blob.core.windows.net/krishdbbacpac/ksqldb01.bacpac" -AdministratorLogin "adminkrishna" -AdministratorLoginPassword $SecurePassword

enter image description here

enter image description here

I also got the message when running the same cmdlets again and again like "There is an import or export operation in progress on the database" so obviously it has tried something" and observed that it is taking some time.

Created 2 databases, 1 with sample data given by Azure and the other database with 1 table and 1 row data. For 1st database, it taken nearly 3 to 5 minutes of time after running the above cmdlet and for 2nd database, it taken 1 minute of time to create the bacpac files.

Related