Start-AzureSqlDatabaseImport
Starts an import operation from blob storage to an Azure SQL Database.
Note
The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.
The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.
Syntax
Start-AzureSqlDatabaseImport
-SqlConnectionContext <ISqlServerConnectionInformation>
-StorageContainer <AzureStorageContainer>
-DatabaseName <String>
-BlobName <String>
[-Edition <DatabaseEdition>]
[-DatabaseMaxSize <Int32>]
[-Profile <AzureSMProfile>]
[<CommonParameters>]
Start-AzureSqlDatabaseImport
-SqlConnectionContext <ISqlServerConnectionInformation>
-StorageContext <IStorageContext>
-StorageContainerName <String>
-DatabaseName <String>
-BlobName <String>
[-Edition <DatabaseEdition>]
[-DatabaseMaxSize <Int32>]
[-Profile <AzureSMProfile>]
[<CommonParameters>]
Description
The Start-AzureSqlDatabaseImport cmdlet starts an import operation from Azure Blob storage to an Azure SQL Database. If the database does not exist, this cmdlet creates it by using the size and edition values that you specify. The operation requires a database server connection context. Use the Get-AzureSqlDatabaseImportExportStatus cmdlet to get the status of the import operation.
Examples
Example 1: Import a database
PS C:\>$Credential = Get-Credential
PS C:\> $SqlContext = New-AzureSqlDatabaseServerContext -ServerName $ServerName -Credentials $Credential
PS C:\> $StorageContext = New-AzureStorageContext -StorageAccountName $StorageName -StorageAccountKey $StorageKey
PS C:\> $Container = Get-AzureStorageContainer -Name $ContainerName -Context $StorageContext
PS C:\> $ImportRequest = Start-AzureSqlDatabaseImport -SqlConnectionContext $SqlContext -StorageContainer $Container -DatabaseName $DatabaseName -BlobName $BlobName
This example initiates an import process from the Blob storage in the $BlobName variable into the Azure SQL Database named DatabaseName.
Parameters
-BlobName
Specifies the name of the Azure Blob storage from which this cmdlet imports the database.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DatabaseMaxSize
Specifies the maximum size, in gigabytes, for the database. If the database does not exist, this cmdlet creates it based on this maximum size. The acceptable values differ based on edition.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DatabaseName
Specifies a name for the database. If the database does not exist, this cmdlet creates it, and assigns the name that this parameter specifies.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Edition
Specifies the edition of the database. If the database does not exist, this cmdlet creates it as this edition. Valid values are:
- None
- Web
- Business
- Basic
- Standard
- Premium
The default is Web.
Type: | DatabaseEdition |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Profile
Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.
Type: | AzureSMProfile |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SqlConnectionContext
Specifies the connection context of a server that contains the database.
Type: | ISqlServerConnectionInformation |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-StorageContainer
Specifies the storage container that contains the Blob from which this cmdlet imports a database.
Type: | AzureStorageContainer |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-StorageContainerName
Specifies the name of the Blob storage container.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-StorageContext
Specifies the context of the Blob storage container.
Type: | IStorageContext |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Outputs
Microsoft.WindowsAzure.Commands.SqlDatabase.Services.ImportExportRequest