Back up SQL Server and Azure SQL to cloud storage
A .bacpac of your SQL Server or Azure SQL database, schema and data together, saved on a schedule into Google Drive, Amazon S3, OneDrive or any other cloud.
Why a .bacpac, not a .bak
A native BACKUP DATABASE writes a .bak file on the database server's own disk, and Azure SQL Database does not offer it at all. A .bacpac is made over an ordinary connection, from anywhere, by Microsoft's sqlpackage. It holds the schema and the data of every table, already compressed, and it imports into SQL Server, Azure SQL or Azure SQL Managed Instance.
By hand it looks like this:
sqlpackage /Action:Export /SourceConnectionString:"Server=tcp:host,1433;Database=shop;User ID=backup;Password=...;Encrypt=True" /TargetFile:shop.bacpac
Steps
- Sign in, open Databases and press Connect a database. Choose SQL Server, or your hosting service by name.
- Paste the connection string (
sqlserver://user:password@host:1433/shop, or an ADO.NET string such asServer=host;Database=shop;User ID=...), or fill in the server, database, username and password one by one. - If the database only answers on its own server, fill in the SSH server fields too; it is then reached through that server, and the database address is usually
localhost. - Press Schedule on its card. Choose the cloud and folder, how many backups to keep (1 to 365), and how often: every 6 hours, every 12 hours, every day, every Sunday or on the 1st of every month.
- Save. The first backup starts at once, and its progress shows in the job list.
What each backup is
- One dated
.bacpacsuch asshop-2026-11-04-020000.bacpac, made withsqlpackage /Action:Export. - Tick tables from the database's own list to export the data of only those; every table's, view's and procedure's definition is still saved.
- Connecting signs in with the username and password, so a wrong one is caught straight away.
- The oldest backups past the number you keep are removed after each good run.
Encrypted backups
Give the database a backup passphrase (12 characters or more) and every backup is encrypted with AES-256 before it leaves our server; its name gains .enc. The cloud you save into then holds nothing readable. To open one on your own computer, with the OpenSSL that comes with macOS, Linux and Git for Windows:
openssl enc -d -aes-256-cbc -pbkdf2 -iter 600000 -in shop-2026-11-04-020000.bacpac.enc -out shop-2026-11-04-020000.bacpac
Keep the passphrase somewhere safe. Without it nobody, including us, can open the backups.
Restoring
A .bacpac only imports into an empty database. Point the connection at a new database name, then press Restore on its card and pick the backup. By hand:
sqlpackage /Action:Import /SourceFile:shop.bacpac /TargetConnectionString:"Server=tcp:host,1433;Database=shop_restored;User ID=...;Password=...;Encrypt=True"
Azure SQL
Choose Azure SQL Database on the connect dialog; encryption is on and the port is 1433. In the Azure portal, add our server's address under the server's Networking firewall rules.
Limits
- A backup is the data at one moment, not a continuous replica or point-in-time recovery.
- A backup stops after 2 hours, or past 20 GB compressed, unless the operator has changed those limits.
- Each backup's size counts towards your transfer allowance.
Questions
Is a .bacpac consistent if the database is being written to?
Not guaranteed. Microsoft's advice is to export when nothing is writing, or to export a copy of the database. Schedule the backup for a quiet hour, or point it at a copy.
Try it
Prepaid: 30 GB free, then 500 GB for ₹100 or 2,500 GB for ₹500, each valid a year. No card is asked for to start.