SQL Server Database Backup to Azure Blob

xu3bshqb  于 2023-08-02  发布在  其他
关注(0)|答案(1)|浏览(81)

How can we take the backup and upload the database hosted in Azure through SQL (preferably, execute a procedure and get it done) to azure blob storage.

4c8rllxm

4c8rllxm1#

Below PowerShell script will export an Azure SQL Database as bacpac and will storage on Azure BLOB account.

$exportRequest = New-AzureRmSqlDatabaseExport -ResourceGroupName $ResourceGroupName -ServerName $ServerName `
  -DatabaseName $DatabaseName -StorageKeytype $StorageKeytype -StorageKey $StorageKey -StorageUri $BacpacUri `
  -AdministratorLogin $creds.UserName -AdministratorLoginPassword $creds.Password

If you want to schedule execution of above export you can create a RunBook using Azure Automation.

相关问题