< Back

New-AzureRmSqlDatabaseImport

Tue Jan 29, 2019 10:09 pm

NAME New-AzureRmSqlDatabaseImport



SYNOPSIS

Imports a .bacpac file and create a new database on the server.





SYNTAX

New-AzureRmSqlDatabaseImport [-ResourceGroupName] <String> [-ServerName] <String> -AdministratorLogin <String> -AdministratorLoginPassword

<SecureString> [-AuthenticationType {None | Sql | AdPassword}] -DatabaseMaxSizeBytes <Int64> -DatabaseName <String> [-DefaultProfile

<IAzureContextContainer>] -Edition {None | Premium | Basic | Standard | DataWarehouse | Stretch | Free | PremiumRS} -ServiceObjectiveName <String>

-StorageKey <String> -StorageKeyType {StorageAccessKey | SharedAccessKey} -StorageUri <Uri> [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

The New-AzureRmSqlDatabaseImport cmdlet imports a bacpac file from an Azure storage account to a new Azure SQL Database. The get import database

status request may be sent to retrieve status information for this request.





PARAMETERS

-AdministratorLogin <String>

Specifies the name of the SQL administrator.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AdministratorLoginPassword <SecureString>

Specifies the password of the SQL administrator.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AuthenticationType <AuthenticationType>

Specifies the type of authentication used to access the server. This parameter defaults to SQL if no authentication type is set.



The acceptable values for this parameter are:



- SQL. SQL authentication. Set the AdministratorLogin and AdministratorLoginPassword parameters to the SQL administrator username and

password. - ADPassword. Azure Active Directory authentication. Set AdministratorLogin and AdministratorLoginPassword to the Azure Active

Directory administrator username and password.



This parameter is only available on SQL Database V12 servers.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DatabaseMaxSizeBytes <Int64>

Specifies the maximum size for the newly imported database.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DatabaseName <String>

Specifies the name of the SQL Database.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Edition <DatabaseEdition>

Specifies the edition of the new database to import to.



The acceptable values for this parameter are:



- Premium



- Basic



- Standard



- DataWarehouse



- Free



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the name of the resource group for the SQL Database server.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ServerName <String>

Specifies the name of the SQL Database server.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ServiceObjectiveName <String>

Specifies the name of the service objective to assign to the Azure SQL Database.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-StorageKey <String>

Specifies the access key for the storage account.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-StorageKeyType <StorageKeyType>

Specifies the type of access key for the storage account.



The acceptable values for this parameter are:



- StorageAccessKey. Uses the storage account key. - SharedAccessKey. Uses the Shared Access Signature (SAS) key.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-StorageUri <Uri>

Specifies the blob URI of the .bacpac file.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.Sql.Database.Model.AzureSqlDatabaseImportExportBaseModel







NOTES





* Keywords: azure, azurerm, arm, resource, management, manager, sql, database, mssql



Example 1: Create an import request for a bacpac file



PS C:\\>New-AzureRmSqlDatabaseImport -ResourceGroupName "RG01" -ServerName "Server01" -DatabaseName "Database01" -StorageKeyType "StorageAccessKey"

-StorageKey "StorageKey01" -StorageUri "http://account01.blob.core.contoso.net/ ... e01.bacpac" -AdministratorLogin "User"

-AdministratorLoginPassword $SecureString -Edition Standard -ServiceObjectiveName S0 -DatabaseMaxSizeBytes 5000000

ResourceGroupName : RG01

ServerName : Server01

DatabaseName : Database01

StorageKeyType : StorageAccessKey

StorageKey :

StorageUri : http://account01.blob.core.contoso.net/ ... e01.bacpac

AdministratorLogin : User

AdministratorLoginPassword :

AuthenticationType : None

OperationStatusLink : https://management.contoso.com/subscrip ... providers/

Microsoft.Sql/servers/server01/databases/database01/importExportOperationResults/00000000-00

0-0000-0000-000000000000?api-version=2014-04-01

Status : InProgress

ErrorMessage :



This command creates an import request to import a .bacpac to a new database.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... baseimport

Get-AzureRmSqlDatabaseImportExportStatus

New-AzureRmSqlDatabaseExport

SQL Database Documentation https://docs.microsoft.com/azure/sql-database/