2

SQL Azure allows for the Automated Export on a scheduled basis to Azure blob storage. This can be configured in the Azure Management Portal on a per database basis.

Is there a way to script this via powershell, REST API or the Windows Azure Management Libraries?

We are developing a sharded database solution with more than 60 shards per environment, which means 100s of databases to configure, doing this manually isn't really an option.

2 Answers 2

1

You have a PowerShell Cmdlet - Start-AzureSqlDatabaseExport - Ref, using that you can start an export of SQL Azure Data to Blob Storage.

You can use that cmdlet in PowerShell Scheduled Job - Ref

You can create a VM Role and run your custom PS script in it. So that All your PS operations will be fast enough.

Sign up to request clarification or add additional context in comments.

Comments

0

I haven't tried it yet but Sandrino Di Mattia wrote about this here -

param([string]$ConnectionString = $(throw "The ConnectionString parameter is required."), 
      [string]$DatabaseName = $(throw "The DatabaseName parameter is required."),
      [string]$OutputFile = $(throw "The OutputFile parameter is required."), 
      [string]$SqlInstallationFolder = "C:\Program Files (x86)\Microsoft SQL Server")

# Load DAC assembly.
$DacAssembly = "$SqlInstallationFolder\110\DAC\bin\Microsoft.SqlServer.Dac.dll"
Write-Host "Loading Dac Assembly: $DacAssembly"
Add-Type -Path $DacAssembly
Write-Host "Dac Assembly loaded."

# Initialize Dac service.
$now = $(Get-Date).ToString("HH:mm:ss")
$Services = new-object Microsoft.SqlServer.Dac.DacServices $ConnectionString
if ($Services -eq $null)
{
    exit
}

# Start the actual export.
Write-Host "Starting backup at $DatabaseName at $now"
$Watch = New-Object System.Diagnostics.StopWatch
$Watch.Start()
$Services.ExportBacpac($OutputFile, $DatabaseName)
$Watch.Stop()
Write-Host "Backup completed in" $Watch.Elapsed.ToString()

1 Comment

Sorry but I've seen that, this allows you to execute an export that is initiated locally, what I am looking to do is configure the Automated Export which takes place solely in the Azure data center. A discussed here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.