New-AzSqlInstance
Creates an Azure SQL Managed Instance.
Syntax
NewByEditionAndComputeGenerationParameterSet (Default)
New-AzSqlInstance
[-Name] <String>
[-ResourceGroupName] <String>
-Location <String>
-SubnetId <String>
-VCore <Int32>
-Edition <String>
-ComputeGeneration <String>
[-AdministratorCredential <PSCredential>]
[-LicenseType <String>]
[-StorageSizeInGB <Int32>]
[-StorageIOps <Int32>]
[-IsGeneralPurposeV2 <Boolean>]
[-Collation <String>]
[-PublicDataEndpointEnabled]
[-ProxyOverride <String>]
[-TimezoneId <String>]
[-Tag <Hashtable>]
[-AssignIdentity]
[-DnsZonePartner <String>]
[-InstancePoolName <String>]
[-MinimalTlsVersion <String>]
[-BackupStorageRedundancy <String>]
[-MaintenanceConfigurationId <String>]
[-PrimaryUserAssignedIdentityId <String>]
[-KeyId <String>]
[-UserAssignedIdentityId <System.Collections.Generic.List`1[System.String]>]
[-IdentityType <String>]
[-AsJob]
[-Force]
[-EnableActiveDirectoryOnlyAuthentication]
[-ExternalAdminName <String>]
[-ExternalAdminSID <Guid>]
[-ZoneRedundant]
[-ServicePrincipalType <String>]
[-DatabaseFormat <String>]
[-PricingModel <String>]
[-AuthenticationMetadata <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
NewByInstancePoolParentObjectParameterSet
New-AzSqlInstance
[-InstancePool] <AzureSqlInstancePoolModel>
[-Name] <String>
-VCore <Int32>
[-AdministratorCredential <PSCredential>]
[-StorageSizeInGB <Int32>]
[-Collation <String>]
[-PublicDataEndpointEnabled]
[-ProxyOverride <String>]
[-TimezoneId <String>]
[-Tag <Hashtable>]
[-AssignIdentity]
[-DnsZonePartner <String>]
[-MinimalTlsVersion <String>]
[-BackupStorageRedundancy <String>]
[-MaintenanceConfigurationId <String>]
[-PrimaryUserAssignedIdentityId <String>]
[-KeyId <String>]
[-UserAssignedIdentityId <System.Collections.Generic.List`1[System.String]>]
[-IdentityType <String>]
[-AsJob]
[-Force]
[-EnableActiveDirectoryOnlyAuthentication]
[-ExternalAdminName <String>]
[-ExternalAdminSID <Guid>]
[-ZoneRedundant]
[-ServicePrincipalType <String>]
[-DatabaseFormat <String>]
[-PricingModel <String>]
[-AuthenticationMetadata <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
NewByInstancePoolResourceIdParameterSet
New-AzSqlInstance
[-InstancePoolResourceId] <String>
[-Name] <String>
-VCore <Int32>
[-AdministratorCredential <PSCredential>]
[-StorageSizeInGB <Int32>]
[-Collation <String>]
[-PublicDataEndpointEnabled]
[-ProxyOverride <String>]
[-TimezoneId <String>]
[-Tag <Hashtable>]
[-AssignIdentity]
[-DnsZonePartner <String>]
[-MinimalTlsVersion <String>]
[-BackupStorageRedundancy <String>]
[-MaintenanceConfigurationId <String>]
[-PrimaryUserAssignedIdentityId <String>]
[-KeyId <String>]
[-UserAssignedIdentityId <System.Collections.Generic.List`1[System.String]>]
[-IdentityType <String>]
[-AsJob]
[-Force]
[-EnableActiveDirectoryOnlyAuthentication]
[-ExternalAdminName <String>]
[-ExternalAdminSID <Guid>]
[-ZoneRedundant]
[-ServicePrincipalType <String>]
[-DatabaseFormat <String>]
[-PricingModel <String>]
[-AuthenticationMetadata <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
NewBySkuNameParameterSetParameter
New-AzSqlInstance
[-Name] <String>
[-ResourceGroupName] <String>
-Location <String>
-SubnetId <String>
-VCore <Int32>
-SkuName <String>
[-AdministratorCredential <PSCredential>]
[-LicenseType <String>]
[-StorageSizeInGB <Int32>]
[-StorageIOps <Int32>]
[-IsGeneralPurposeV2 <Boolean>]
[-Collation <String>]
[-PublicDataEndpointEnabled]
[-ProxyOverride <String>]
[-TimezoneId <String>]
[-Tag <Hashtable>]
[-AssignIdentity]
[-DnsZonePartner <String>]
[-InstancePoolName <String>]
[-MinimalTlsVersion <String>]
[-BackupStorageRedundancy <String>]
[-MaintenanceConfigurationId <String>]
[-PrimaryUserAssignedIdentityId <String>]
[-KeyId <String>]
[-UserAssignedIdentityId <System.Collections.Generic.List`1[System.String]>]
[-IdentityType <String>]
[-AsJob]
[-Force]
[-EnableActiveDirectoryOnlyAuthentication]
[-ExternalAdminName <String>]
[-ExternalAdminSID <Guid>]
[-ZoneRedundant]
[-ServicePrincipalType <String>]
[-DatabaseFormat <String>]
[-PricingModel <String>]
[-AuthenticationMetadata <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-AzSqlInstance cmdlet creates an Azure SQL Managed instance.
Examples
Example 1: Create a new instance
New-AzSqlInstance -Name managedInstance1 -ResourceGroupName ResourceGroup01 -Location westcentralus -AdministratorCredential (Get-Credential) -SubnetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name" -LicenseType LicenseIncluded -StorageSizeInGB 1024 -VCore 16 -SkuName GP_Gen4 -DnsZonePartner "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/partnerServerForDnsZone"
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Tags :
Identity : Microsoft.Azure.Management.Sql.Models.ResourceIdentity
Sku : Microsoft.Azure.Management.Internal.Resources.Models.Sku
IsGeneralPurposeV2 : false
FullyQualifiedDomainName : managedInstance1.wcusxxxxxxxxxxxxx.database.windows.net
AdministratorLogin : adminLogin1
AdministratorPassword :
SubnetId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name
LicenseType : LicenseIncluded
VCores : 16
StorageSizeInGB : 1024
StorageIOps :
DnsZone : ad35cna0mw
InstancePoolName :
This command creates a new instance by using the SkuName parameter.
Example 2: Create a new instance
New-AzSqlInstance -Name managedInstance2 -ResourceGroupName ResourceGroup01 -Location westcentralus -AdministratorCredential (Get-Credential) -SubnetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name" -LicenseType LicenseIncluded -StorageSizeInGB 1024 -VCore 16 -Edition "GeneralPurpose" -ComputeGeneration Gen4
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance2
Tags :
Identity : Microsoft.Azure.Management.Sql.Models.ResourceIdentity
Sku : Microsoft.Azure.Management.Internal.Resources.Models.Sku
IsGeneralPurposeV2 : false
FullyQualifiedDomainName : managedInstance1.wcusxxxxxxxxxxxxx.database.windows.net
AdministratorLogin : adminLogin1
AdministratorPassword :
SubnetId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name
LicenseType : LicenseIncluded
VCores : 16
StorageSizeInGB : 1024
StorageIOps :
DnsZone : ad35cna0mw
InstancePoolName :
This command creates a new instance by using by using Edition and ComputeGeneration parameters.
Example 3: Create a new GPv2 instance
New-AzSqlInstance -Name "managedInstance3" -ResourceGroupName "ResourceGroup01" -Location "westcentralus" -AdministratorCredential (Get-Credential) -SubnetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name" -LicenseType "LicenseIncluded" -StorageSizeInGB 1024 -StorageIOps 4000 -VCore 8 -SkuName "GP_Gen5" -IsGeneralPurposeV2 $true
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance3
Tags :
Identity : Microsoft.Azure.Management.Sql.Models.ResourceIdentity
Sku : Microsoft.Azure.Management.Internal.Resources.Models.Sku
IsGeneralPurposeV2 : true
FullyQualifiedDomainName : managedInstance3.wcusxxxxxxxxxxxxx.database.windows.net
AdministratorLogin : adminLogin1
AdministratorPassword :
SubnetId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name
LicenseType : LicenseIncluded
VCores : 8
StorageSizeInGB : 1024
StorageIOps : 4000
DnsZone : ad35cna0mw
InstancePoolName :
This command creates a new GPv2 instance by using the SkuName parameter.
Example 4: Create a new GPv2 instance
New-AzSqlInstance -Name "managedInstance4" -ResourceGroupName "ResourceGroup01" -Location "westcentralus" -AdministratorCredential (Get-Credential) -SubnetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name" -LicenseType "LicenseIncluded" -StorageSizeInGB 1024 -StorageIOps 4000 -VCore 8 -Edition "GeneralPurpose" -ComputeGeneration "Gen5" -IsGeneralPurposeV2 $true
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance4
Tags :
Identity : Microsoft.Azure.Management.Sql.Models.ResourceIdentity
Sku : Microsoft.Azure.Management.Internal.Resources.Models.Sku
IsGeneralPurposeV2 : true
FullyQualifiedDomainName : managedInstance4.wcusxxxxxxxxxxxxx.database.windows.net
AdministratorLogin : adminLogin1
AdministratorPassword :
SubnetId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name
LicenseType : LicenseIncluded
VCores : 8
StorageSizeInGB : 1024
StorageIOps : 4000
StorageIOps :
DnsZone : ad35cna0mw
InstancePoolName :
This command creates a new GPv2 instance by using by using Edition and ComputeGeneration parameters.
Example 5: Create a new instance in an instance pool using an instance pool object
$instancePool = Get-AzSqlInstancePool -ResourceGroupName resourcegroup01 -Name instancepool0
$instancePool | New-AzSqlInstance -Name managedInstance2 -AdministratorCredential (Get-Credential) -LicenseType LicenseIncluded -StorageSizeInGB 1024 -VCore 2
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance2
Tags :
Identity : Microsoft.Azure.Management.Sql.Models.ResourceIdentity
Sku : Microsoft.Azure.Management.Internal.Resources.Models.Sku
FullyQualifiedDomainName : managedInstance1.wcusxxxxxxxxxxxxx.database.windows.net
AdministratorLogin : adminLogin1
AdministratorPassword :
SubnetId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name
LicenseType : LicenseIncluded
VCores : 2
StorageSizeInGB : 1024
DnsZone : ad35cna0mw
InstancePoolName : instancepool0
This command creates a new instance in an instance pool using an instance pool object.
Example 6: Create a new instance in an instance pool using an instance pool resource identifier
New-AzSqlInstance -Name managedInstance2 -AdministratorCredential (Get-Credential) -StorageSizeInGB 1024 -VCore 2 -InstancePoolResourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/instancePools/instancePool0"
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance2
Tags :
Identity : Microsoft.Azure.Management.Sql.Models.ResourceIdentity
Sku : Microsoft.Azure.Management.Internal.Resources.Models.Sku
FullyQualifiedDomainName : managedInstance1.wcusxxxxxxxxxxxxx.database.windows.net
AdministratorLogin : adminLogin1
AdministratorPassword :
SubnetId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name
LicenseType : LicenseIncluded
VCores : 2
StorageSizeInGB : 1024
DnsZone : ad35cna0mw
InstancePoolName : instancepool0
This command creates a new instance in an instance pool using the instance pool's resource identifier.
Example 7: Create a new instance in an instance pool
New-AzSqlInstance -Name managedInstance1 -ResourceGroupName resourceGroup01 -Location westcentralus -AdministratorCredential (Get-Credential) -SubnetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name" -LicenseType LicenseIncluded -StorageSizeInGB 32 -VCore 2 -ComputeGeneration Gen5 -Edition GeneralPurpose -InstancePoolName instancePool0
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Tags :
Identity : Microsoft.Azure.Management.Sql.Models.ResourceIdentity
Sku : Microsoft.Azure.Management.Internal.Resources.Models.Sku
FullyQualifiedDomainName : managedInstance1.wcusxxxxxxxxxxxxx.database.windows.net
AdministratorLogin : adminLogin1
AdministratorPassword :
SubnetId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name
LicenseType : LicenseIncluded
VCores : 2
StorageSizeInGB : 32
DnsZone : ad35cna0mw
InstancePoolName : instancePool0
This command creates a new instance in an instance pool with name instancePool0
Example 8: Create a new instance with maintenance configuration
New-AzSqlInstance -Name managedInstance1 -ResourceGroupName resourcegroup01 -Location "westus" -AdministratorCredential (Get-Credential) -SubnetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name" -VCore 8 -ComputeGeneration Gen5 -Edition GeneralPurpose -MaintenanceConfigurationId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_WestUS_MI_2"
Location : westus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Tags :
Identity :
Sku : Microsoft.Azure.Management.Internal.Resources.Models.Sku
IsGeneralPurposeV2 : false
FullyQualifiedDomainName : managedInstance1.wusxxxxxxxxxxxxx.database.windows.net
AdministratorLogin : adminLogin1
AdministratorPassword :
SubnetId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name
LicenseType : LicenseIncluded
VCores : 8
StorageSizeInGB : 256
StorageIOps :
Collation : SQL_Latin1_General_CP1_CI_AS
PublicDataEndpointEnabled : False
ProxyOverride :
TimezoneId : UTC
DnsZonePartner :
DnsZone : ad35cna0mw
InstancePoolName :
MinimalTlsVersion :
CurrentBackupStorageRedundancy : Geo
RequestedBackupStorageRedundancy : Geo
MaintenanceConfigurationId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_WestUS_MI_2
This command creates a new instance with maintenance configuration MI_2
Example 9: Create a new instance with External (Microsoft Entra ID) Administrator, Microsoft Entra-only Authentication and no SqlAdministratorCredentials
New-AzSqlInstance -Name managedInstance2 -ResourceGroupName ResourceGroup01 -ExternalAdminName DummyLogin -EnableActiveDirectoryOnlyAuthentication -Location westcentralus -SubnetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name" -LicenseType LicenseIncluded -StorageSizeInGB 1024 -VCore 16 -Edition "GeneralPurpose" -ComputeGeneration Gen4
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance2
Tags :
Identity : Microsoft.Azure.Management.Sql.Models.ResourceIdentity
Sku : Microsoft.Azure.Management.Internal.Resources.Models.Sku
IsGeneralPurposeV2 : false
FullyQualifiedDomainName : managedInstance1.wcusxxxxxxxxxxxxx.database.windows.net
AdministratorLogin : adminLogin1
AdministratorPassword :
SubnetId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name
LicenseType : LicenseIncluded
VCores : 16
StorageSizeInGB : 1024
StorageIOps :
DnsZone : ad35cna0mw
InstancePoolName :
Administrators :
$val = Get-AzSqlInstance -Name managedInstance2 -ResourceGroupName ResourceGroup01 -ExpandActiveDirectoryAdministrator
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance2
Tags :
Identity : Microsoft.Azure.Management.Sql.Models.ResourceIdentity
Sku : Microsoft.Azure.Management.Internal.Resources.Models.Sku
IsGeneralPurposeV2 : false
FullyQualifiedDomainName : managedInstance1.wcusxxxxxxxxxxxxx.database.windows.net
AdministratorLogin : adminLogin1
AdministratorPassword :
SubnetId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name
LicenseType : LicenseIncluded
VCores : 16
StorageSizeInGB : 1024
StorageIOps :
DnsZone : ad35cna0mw
InstancePoolName :
Administrators : Microsoft.Azure.Management.Sql.Models.ManagedInstanceExternalAdministrator
$val.Administrators
AdministratorType : ActiveDirectory
PrincipalType : Group
Login : DummyLogin
Sid : df7667b8-f9fd-4029-a0e3-b43c75ce9538
TenantId : 00001111-aaaa-2222-bbbb-3333cccc4444
AzureADOnlyAuthentication : True
This command creates a new instance with external administrator properties and Microsoft Entra-only authentication enabled.
Example 10: Create a new zone - redundant instance
New-AzSqlInstance -Name managedInstance1 -ResourceGroupName ResourceGroup01 -Location westcentralus -AdministratorCredential (Get-Credential) -SubnetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name" -LicenseType LicenseIncluded -StorageSizeInGB 1024 -VCore 16 -SkuName GP_Gen4 -DnsZonePartner "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/partnerServerForDnsZone" -ZoneRedundant
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Tags :
Identity : Microsoft.Azure.Management.Sql.Models.ResourceIdentity
Sku : Microsoft.Azure.Management.Internal.Resources.Models.Sku
IsGeneralPurposeV2 : false
FullyQualifiedDomainName : managedInstance1.wcusxxxxxxxxxxxxx.database.windows.net
AdministratorLogin : adminLogin1
AdministratorPassword :
SubnetId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name
LicenseType : LicenseIncluded
VCores : 16
StorageSizeInGB : 1024
StorageIOps :
DnsZone : ad35cna0mw
InstancePoolName :
ZoneRedundant : true
This command creates a new zone - redundant instance.
Example 11: Create a new instance with TDE CMK
New-AzSqlInstance -Name managedInstance1 -ResourceGroupName ResourceGroup01 -Location westcentralus -AdministratorCredential (Get-Credential) -SubnetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name" -LicenseType LicenseIncluded -StorageSizeInGB 1024 -VCore 16 -SkuName GP_Gen4 -DnsZonePartner "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/partnerServerForDnsZone" -AssignIdentity -IdentityType "UserAssigned" -PrimaryUserAssignedIdentityId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity01" -UserAssignedIdentityId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity01" -KeyId "https://contoso.vault.azure.net/keys/contosokey/01234567890123456789012345678901"
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Tags :
Identity : Microsoft.Azure.Management.Sql.Models.ResourceIdentity
Sku : Microsoft.Azure.Management.Internal.Resources.Models.Sku
IsGeneralPurposeV2 : false
FullyQualifiedDomainName : managedInstance1.wcusxxxxxxxxxxxxx.database.windows.net
AdministratorLogin : adminLogin1
AdministratorPassword :
SubnetId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name
LicenseType : LicenseIncluded
VCores : 16
StorageSizeInGB : 1024
StorageIOps :
DnsZone : ad35cna0mw
InstancePoolName :
KeyId : https://contoso.vault.azure.net/keys/contosokey/01234567890123456789012345678901
PrimaryUserAssignedIdentityId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity01
This command creates a new managed instance with TDE CMK enabled.
New-AzSqlInstance -Name managedInstance1 -ResourceGroupName ResourceGroup01 -Location westcentralus -AdministratorCredential (Get-Credential) -SubnetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name" -LicenseType LicenseIncluded -StorageSizeInGB 1024 -VCore 16 -SkuName GP_Gen4 -DnsZonePartner "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/partnerServerForDnsZone" -DatabaseFormat AlwaysUpToDate -PricingModel Regular
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Tags :
Identity : Microsoft.Azure.Management.Sql.Models.ResourceIdentity
Sku : Microsoft.Azure.Management.Internal.Resources.Models.Sku
IsGeneralPurposeV2 : false
FullyQualifiedDomainName : managedInstance1.wcusxxxxxxxxxxxxx.database.windows.net
AdministratorLogin : adminLogin1
AdministratorPassword :
SubnetId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name
LicenseType : LicenseIncluded
VCores : 16
StorageSizeInGB : 1024
StorageIOps :
DnsZone : ad35cna0mw
DatabaseFormat : AlwaysUpToDate
PricingModel : Regular
This command creates a new instance with database format and pricing model specified.
New-AzSqlInstance -Name managedInstance1 -ResourceGroupName ResourceGroup01 -Location westcentralus -AdministratorCredential (Get-Credential) -SubnetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name" -LicenseType LicenseIncluded -StorageSizeInGB 1024 -VCore 16 -SkuName GP_Gen5 -AuthenticationMetadata Windows
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Tags :
Identity :
Sku : Microsoft.Azure.Management.Internal.Resources.Models.Sku
FullyQualifiedDomainName : managedInstance1.xxxxxxxxxxxx.database.windows.net
AdministratorLogin : adminLogin1
AdministratorPassword :
SubnetId : subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name
LicenseType : LicenseIncluded
VCores : 16
StorageSizeInGB : 1024
Collation : SQL_Latin1_General_CP1_CI_AS
PublicDataEndpointEnabled : False
ProxyOverride : Default
TimezoneId : UTC
DnsZonePartner :
DnsZone : ad35cna0mw
InstancePoolName :
MinimalTlsVersion : None
BackupStorageRedundancy : Geo
RequestedBackupStorageRedundancy : Geo
CurrentBackupStorageRedundancy : Geo
MaintenanceConfigurationId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Maintenance/
publicMaintenanceConfigurations/SQL_Default
Administrators :
PrimaryUserAssignedIdentityId :
KeyId :
ZoneRedundant : False
ServicePrincipal :
DatabaseFormat : SQLServer2022
PricingModel : Regular
ExternalGovernanceStatus : Disabled
AuthenticationMetadata : Windows
This command creates a new managed instance which uses Windows metadata for authentication of synced users.
Parameters
-AdministratorCredential
The SQL authentication credential of the instance.
Parameter properties
Type: PSCredential
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-AsJob
Run cmdlet in the background
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-AssignIdentity
Generate and assign a Microsoft Entra identity for this Managed instance for use with key management services like Azure KeyVault.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
Preferred metadata to use for authentication of synced on-prem users. Default is AzureAD.
Type: String
Default value: None
Accepted values: AzureAD, Paired, Windows
Supports wildcards: False
DontShow: False
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-BackupStorageRedundancy
The Backup storage redundancy used to store backups for the Sql Azure Managed Instance. Options are: Local, Zone and Geo
Parameter properties
Type: String
Default value: None
Accepted values: Local, Zone, Geo, GeoZone
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Collation
The collation of the Azure SQL Managed Instance to use.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ComputeGeneration
The compute generation for the instance.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
NewByEditionAndComputeGenerationParameterSet
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-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
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
The database format for the instance. Possible values are:
AlwaysUpToDate - The instance gets access to all new SQL engine features as soon as they are released in Azure. Database format keeps evolving to accommodate new features.
SQLServer2022 - The instance keeps getting SQL engine bug fixes, security patches and small functional improvements via Cumulative Updates for SQL Server 2022 during its mainstream support period. Database format remains compatible with SQL Server 2022 during that time.
Type: String
Default value: None
Supports wildcards: False
DontShow: False
NewByEditionAndComputeGenerationParameterSet
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-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
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DnsZonePartner
The resource id of the partner Managed Server to inherit DnsZone property from for Managed instance creation
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Edition
The edition for the instance.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
NewByEditionAndComputeGenerationParameterSet
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-EnableActiveDirectoryOnlyAuthentication
Enable Active Directory Only Authentication on the server.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ExternalAdminName
Specifies the display name of the user, group or application which is the Microsoft Entra administrator for the server. This display name must exist in the active directory associated with the current subscription.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ExternalAdminSID
Specifies the object ID of the user, group or application which is the Microsoft Entra administrator.
Parameter properties
Type: Nullable<T> [ Guid ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Force
Skip confirmation message for performing the action
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-IdentityType
Type of identity to be assigned to the server. Possible values are SystemAssigned, UserAssigned, 'SystemAssigned,UserAssigned' and None.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-InstancePool
The instance pool parent object.
Parameter properties
Parameter sets
NewByInstancePoolParentObjectParameterSet
Position: 0
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-InstancePoolName
The instance pool to place this instance in.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
NewByEditionAndComputeGenerationParameterSet
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
NewBySkuNameParameterSetParameter
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-InstancePoolResourceId
The instance pool resource id.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: ResourceId
Parameter sets
NewByInstancePoolResourceIdParameterSet
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-IsGeneralPurposeV2
Whether or not this is a GPv2 variant of General Purpose edition.
Parameter properties
Parameter sets
NewByEditionAndComputeGenerationParameterSet
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
NewBySkuNameParameterSetParameter
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-KeyId
The Azure Key Vault URI that is used for encryption.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LicenseType
Determines which License Type to use. Possible values are:
BasePrice - Azure Hybrid Benefit (AHB) discounted pricing for existing SQL Server license owners is applied. Managed Instance service price will be discounted for existing SQL Server license owners.
LicenseIncluded - Azure Hybrid Benefit (AHB) discount pricing for existing SQL Server license owners is not applied. Managed Instance service price will include a new SQL Server license costs.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
NewByEditionAndComputeGenerationParameterSet
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
NewBySkuNameParameterSetParameter
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Location
The ___location in which to create the instance
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
NewByEditionAndComputeGenerationParameterSet
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
NewBySkuNameParameterSetParameter
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-MaintenanceConfigurationId
The Maintenance configuration id for the Sql Azure Managed Instance.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-MinimalTlsVersion
The minimal TLS version to enforce for Managed instance
Parameter properties
Type: String
Default value: None
Accepted values: None, 1.0, 1.1, 1.2
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Name
Instance name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: InstanceName
Parameter sets
(All)
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-PricingModel
The pricing model for the instance.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
NewByEditionAndComputeGenerationParameterSet
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-PrimaryUserAssignedIdentityId
The primary User Managed Identity(UMI) id.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ProxyOverride
The connection type used for connecting to the instance.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-PublicDataEndpointEnabled
Whether or not the public data endpoint is enabled for the instance.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceGroupName
The name of the resource group.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
NewByEditionAndComputeGenerationParameterSet
Position: 1
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
NewBySkuNameParameterSetParameter
Position: 1
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ServicePrincipalType
Type of Service Principal to be used. Possible values are SystemAssigned and None.
Parameter properties
Type: String
Default value: None
Accepted values: None, SystemAssigned
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-SkuName
The SKU name for the instance e.g.
'GP_Gen4', 'BC_Gen4'.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
NewBySkuNameParameterSetParameter
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-StorageIOps
Determines how much Storage IOps to associate with instance
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
NewByEditionAndComputeGenerationParameterSet
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
NewBySkuNameParameterSetParameter
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-StorageSizeInGB
Determines how much Storage size to associate with instance
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-SubnetId
The Subnet Id to use for instance creation
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
NewByEditionAndComputeGenerationParameterSet
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
NewBySkuNameParameterSetParameter
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Tag
The tags to associate with the instance
Parameter properties
Type: Hashtable
Default value: None
Supports wildcards: False
DontShow: False
Aliases: Tags
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-TimezoneId
The time zone id for the instance to set. A list of time zone ids is exposed through the sys.time_zone_info (Transact-SQL) view.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-UserAssignedIdentityId
The list of user assigned identities.
Parameter properties
Type: List<T> [ String ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-VCore
Determines how much VCore to associate with instance
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-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
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ZoneRedundant
Use zone redundant storage
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
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 .
None
Outputs