Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

New-AzSqlInstanceDatabase

Module:
Az.Sql Module

Creates an Azure SQL Managed Instance database.

Syntax

CreateNewInstanceDatabaseFromInputParameters (Default)

New-AzSqlInstanceDatabase
 [-Name] <String>
 [-InstanceName] <String>
 [-ResourceGroupName] <String>
 [-Collation <String>]
 [-Tag <Hashtable>]
 [-AsJob]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-EnableLedger]
 [-Confirm]
 [<CommonParameters>]

CreateNewInstanceDatabaseFromAzureSqlManagedInstanceModelInstanceDefinition

New-AzSqlInstanceDatabase
 [-Name] <String>
 [-InstanceObject] <AzureSqlManagedInstanceModel>
 [-Collation <String>]
 [-Tag <Hashtable>]
 [-AsJob]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

CreateNewInstanceDatabaseFromAzureSqlInstanceResourceId

New-AzSqlInstanceDatabase
 [-Name] <String>
 [-InstanceResourceId] <String>
 [-Collation <String>]
 [-Tag <Hashtable>]
 [-AsJob]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

Description

The New-AzSqlInstanceDatabase cmdlet creates an Azure SQL Managed instance database.

Examples

Example 1: Create a database on a specified instance

New-AzSqlInstanceDatabase -Name "Database01" -InstanceName "managedInstance1" -ResourceGroupName "ResourceGroup01"
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1/databases/Database01
Name : Database01
Tags :
Collation : SQL_Latin1_General_CP1_CI_AS
Status : Online
CreationDate : 4/27/2018 2:30:07 PM
EarliestRestorePoint : 4/27/2018 2:40:47 PM
RestorePointInTime :
DefaultSecondaryLocation : West US 2
CatalogCollation :
CreateMode :
EnableLedger : False
StorageContainerUri :
StorageContainerSasToken :
SourceDatabaseId :
FailoverGroupId :

This command creates a instance database named Database01 on instance managedInstance1.

Parameters

-AsJob

Run cmdlet in the background

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Collation

The collation of the Azure SQL Instance Database collation to use.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

-EnableLedger

Creates a ledger database, in which the integrity of all data is protected by the ledger feature. All tables in the ledger database must be ledger tables. Note: the value of this property cannot be changed after the database has been created.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

-InstanceName

The instance name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-InstanceObject

The instance object

Parameter properties

Type:AzureSqlManagedInstanceModel
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ParentObject

Parameter sets

-InstanceResourceId

The instance resource id

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ParentResourceId

Parameter sets

-Name

The name of the Azure SQL Instance Database to create.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:InstanceDatabaseName

Parameter sets

-ResourceGroupName

The name of the resource group.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Tag

The tags to associate with the Azure Sql Instance Database

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Tags

Parameter sets

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

AzureSqlManagedInstanceModel

String

Outputs

AzureSqlManagedDatabaseModel


Feedback

Was this page helpful?