Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/EzriCloud/azuresql-saveas
Creates Copies of An Azure SQL database, and saves as bacpac files for easy restore
https://github.com/EzriCloud/azuresql-saveas
Last synced: 9 days ago
JSON representation
Creates Copies of An Azure SQL database, and saves as bacpac files for easy restore
- Host: GitHub
- URL: https://github.com/EzriCloud/azuresql-saveas
- Owner: EzriCloud
- Created: 2017-12-12T17:40:00.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-14T15:22:28.000Z (almost 7 years ago)
- Last Synced: 2024-05-23T00:30:40.348Z (7 months ago)
- Language: PowerShell
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - EzriCloud/azuresql-saveas - Creates Copies of An Azure SQL database, and saves as bacpac files for easy restore (PowerShell)
README
# AzureSQL-SaveAs
**NOTE** These scripts are designed to work for one specific purpose. They were not generalized, and often have hard-coded database names in them.
If you want to use the scripts, review this documentation and update the scripts accordingly.## On your CI Server
1. Run the `on-the-ci-server\01-create-databases-as-copy-of.sql` script.
1. For each of your newly created support databases, execute cleanup scripts `on-the-ci-servers\02-support_db_assistan.sql` . These scripts are specific to your needs and should be created any way you want.
1. `iwr -Uri 'https://raw.githubusercontent.com/EzriCloud/azuresql-saveas/master/BackupAzureSql.ps1' -OutFile 'BackupAzureSql.ps1'`
1. Setup your build variables with your Azure Secrets, and run
1. Powershell Script `BackupAzureSql.ps1 -TenantId $(TenantId) -SubscriptionId $(SubscriptionId) -ApplicationId $(ApplicationId) -ApplicationKey $(ApplicationKey) -DBResourceGroup "MyDBResourceGroup" -DBServer "MyDbServerName" -PasswordVaultName "AzureVaultWhereIKeepMyPasswords" -Databases "Support_Production,Support_Staging" -DumpResourceGroup "ResourceGroupOfStorageAccount" -DumpStorageAccount "StorageAccountName" -ProvideUpdates`## On your client machine
### To Download `Support_Production`
`DownloadBacpac.cmd azurecontainername Support_Production`### To Restore `Support_Production` as `Support_ProductionMyOwnCopy`
`RestoreBacpac.cmd Support_Production MyOwnCopy`