New-AzureRmSqlDatabaseImport
Imports a .bacpac file and create a new database on the server.
Important
Because Az PowerShell modules now have all the capabilities of AzureRM PowerShell modules and more, we'll retire AzureRM PowerShell modules on 29 February 2024.
To avoid service interruptions, update your scripts that use AzureRM PowerShell modules to use Az PowerShell modules by 29 February 2024. To automatically update your scripts, follow the quickstart guide.
Syntax
New-AzureRmSqlDatabaseImport
-DatabaseName <String>
-Edition <DatabaseEdition>
-ServiceObjectiveName <String>
-DatabaseMaxSizeBytes <Int64>
[-ServerName] <String>
-StorageKeyType <StorageKeyType>
-StorageKey <String>
-StorageUri <Uri>
-AdministratorLogin <String>
-AdministratorLoginPassword <SecureString>
[-AuthenticationType <AuthenticationType>]
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<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.
Examples
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/bacpacs/database01.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/bacpacs/database01.bacpac
AdministratorLogin : User
AdministratorLoginPassword :
AuthenticationType : None
OperationStatusLink : https://management.contoso.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource01/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.
Parameters
Specifies the name of the SQL administrator.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the password of the SQL administrator.
| Type: | SecureString |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
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.
| Type: | AuthenticationType |
| Accepted values: | None, Sql, AdPassword |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the maximum size for the newly imported database.
| Type: | Int64 |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the name of the SQL Database.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with azure
| Type: | IAzureContextContainer |
| Aliases: | AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the edition of the new database to import to. The acceptable values for this parameter are:
- Premium
- Basic
- Standard
- DataWarehouse
- Free
| Type: | DatabaseEdition |
| Accepted values: | None, Premium, Basic, Standard, DataWarehouse, Stretch, Free, PremiumRS, GeneralPurpose, BusinessCritical |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the name of the resource group for the SQL Database server.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies the name of the SQL Database server.
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies the name of the service objective to assign to the Azure SQL Database.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the access key for the storage account.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
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.
| Type: | StorageKeyType |
| Accepted values: | StorageAccessKey, SharedAccessKey |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the blob URI of the .bacpac file.
| Type: | Uri |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Inputs
Outputs
AzureSqlDatabaseImportExportBaseModel
Notes
- Keywords: azure, azurerm, arm, resource, management, manager, sql, database, mssql