Export using Azure Portal
a) Logon to the Azure Portal
b) Navigate to the Azure SQL Database that needs to be exported and also make sure that you have a Azure Storage service provisioned which will hold the bacpac files.
c) Select the "Export" button.
d) Provide the details. Export bacpac file name, storage container and credentials and click ok.
e) You may receive an error with the following message.
Database export error
Failed to export the database: export-database-db.
ErrorCode: 400
ErrorMessage: There was an error that occurred during this operation : '
f) Set the Firewall rules to allow the IP address of the machine that tries to initiate the export as shown below.
g) Once done repeat step b) and initiate the export again.
h) Export request will be submitted and you also check the progress as shown below.
i) Once the request is complete, the bacpac file will be successfully created in the storage container.
Export using SQLPackage Utility
SQLPackage is a command-line utility that is used to export, import, extract, publish and run T-SQL scripts against databases.Download the SQLPackage Utility
Check syntax here
Note: SqlPackage.exe will be located under "C:\Program Files\Microsoft SQL Server\150\DAC\bin" post the installation.
For using Windows Authentication, run the following command to get the bacpac file.
SqlPackage.exe /a:Export /tf:export-database-db.bacpac /scs:"Data Source=export-database-db-server.database.windows.net;Initial Catalog=export-database-db;" /ua:True /tid:"xxxxxx.onmicrosoft.com"
For using SQL Authentication, run the following command to get the bacpac file.
SqlPackage.exe /a:Export /tf:export-database-db.bacpac /scs:"Data Source=export-database-db-server.database.windows.net;Initial Catalog=export-database-db;user id=xxxxx;password=xxxxxx" /ua:False
No comments:
Post a Comment