Start-​Azure​Sql​Database​Import

Starts an import operation from blob storage to an Azure SQL Database.

Syntax

Start-AzureSqlDatabaseImport
     -BlobName <String>
     [-DatabaseMaxSize <Int32>]
     -DatabaseName <String>
     [-Edition <DatabaseEdition>]
     [-Profile <AzureSMProfile>]
     -SqlConnectionContext <ISqlServerConnectionInformation>
     -StorageContainer <AzureStorageContainer>
     [<CommonParameters>]
Start-AzureSqlDatabaseImport
     -BlobName <String>
     [-DatabaseMaxSize <Int32>]
     -DatabaseName <String>
     [-Edition <DatabaseEdition>]
     [-Profile <AzureSMProfile>]
     -SqlConnectionContext <ISqlServerConnectionInformation>
     -StorageContainerName <String>
     -StorageContext <AzureStorageContext>
     [<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.

Required Parameters

-BlobName

Specifies the name of the Azure Blob storage from which this cmdlet imports the database.

Type:String
Position:Named
Default value:None
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
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
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
Accept pipeline input:False
Accept wildcard characters:False
-StorageContainerName

Specifies the name of the Blob storage container.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StorageContext

Specifies the context of the Blob storage container.

Type:AzureStorageContext
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-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
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
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
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Microsoft.WindowsAzure.Commands.SqlDatabase.Services.ImportExportRequest