Home » Microsoft » 70-473 v.2 » Which commands should you run in an Azure PowerShell script?
DRAG DROP
You need to export a Microsoft Azure SQL database named DB1 from a server named Server1. The credentials to connect to Server1 are stored in a variable named $credential.
The backup of the database must be stored in a storage account named Storage1 in a container named Container1.
Which commands should you run in an Azure PowerShell script? To answer, drag the appropriate values to the correct targets. Each value may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
Select and Place:
Correct Answer:
Explanation/Reference:
Explanation:
Box 1:
$SqlContext = New-AzureSqlDatabaseServerContext -ServerName $ServerName -Credential $Credential
Box 2:
PS C:> $StorageContext = New-AzureStorageContext -StorageAccountName $StorageName -StorageAccountKey $StorageKey
Box 3:
$Container = Get-AzureStorageContainer -Name $ContainerName -Context $StorageContext
Box 4: Start-AzureSqlDatabaseExport
The Start-AzureSqlDatabaseExport command starts an export operation from an Azure SQL Database to Blob storage.
Example 1: Export a database
PS C:>$Credential = Get-Credential
PS C:> $SqlContext = New-AzureSqlDatabaseServerContext -ServerName $ServerName -Credential $Credential
PS C:> $StorageContext = New-AzureStorageContext -StorageAccountName $StorageName -StorageAccountKey $StorageKey
PS C:> $Container = Get-AzureStorageContainer -Name $ContainerName -Context $StorageContext
PS C:> $exportRequest = Start-AzureSqlDatabaseExport -SqlConnectionContext $SqlContext -StorageContainer $Container -Data
Reference: https://github.com/Azure/azure-docs-powershell/blob/master/azuresmps-4.0.0/Azure/Start-AzureSqlDatabaseExport.md