Created
August 21, 2012 12:16
-
-
Save hunt3ri/3415007 to your computer and use it in GitHub Desktop.
Powershell script for backing up SQL Azure db
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################### | |
# Description: Backup Script for Sql Azure DB | |
# Author: Iain Hunter | |
# Date: 21/08/12 | |
############################################################################### | |
$today = Get-Date | |
$todayStr = $today.ToString("yyyyMMdd") | |
$backupFile = "your-db" + $todayStr + ".bacpac" | |
echo "Exporting backup to: $backupFile" | |
# Export DB to blob storage with datestamp | |
C:\dev\tools\DAC-ImportExport-1.6\DacIESvcCli -S YOUR-SQL-AZURE-SERVERNAME.database.windows.net -U YOUR-SQL-AZURE-USERNAME -P YOUR-SQL-AZURE-DB-PASSWORD -D YOUR-SQL-AZURE-DB-NAME -X -BLOBACCESSKEY YOUR-BLOB-STORAGE-ACCOUNT-KEY -BLOBURL YOUR-BLOB-STORAGE-ADDRESS/CONTAINER-NAME/$backupFile -ACCESSKEYTYPE storage | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment