Creates a database or an elastic database.
Syntax DtuBasedDatabase (Default)New-AzSqlDatabase
[-ServerName] <String>
[-ResourceGroupName] <String>
-DatabaseName <String>
[-CollationName <String>]
[-CatalogCollation <String>]
[-MaxSizeBytes <Int64>]
[-Edition <String>]
[-RequestedServiceObjectiveName <String>]
[-ElasticPoolName <String>]
[-ReadScale <DatabaseReadScale>]
[-Tags <Hashtable>]
[-SampleName <String>]
[-ZoneRedundant]
[-AsJob]
[-Force]
[-LicenseType <String>]
[-AutoPauseDelayInMinutes <Int32>]
[-MinimumCapacity <Double>]
[-HighAvailabilityReplicaCount <Int32>]
[-BackupStorageRedundancy <String>]
[-SecondaryType <String>]
[-MaintenanceConfigurationId <String>]
[-EnableLedger]
[-PreferredEnclaveType <String>]
[-AssignIdentity]
[-EncryptionProtector <String>]
[-UserAssignedIdentityId <String[]>]
[-KeyList <String[]>]
[-FederatedClientId <Guid>]
[-EncryptionProtectorAutoRotation]
[-UseFreeLimit]
[-FreeLimitExhaustionBehavior <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
VcoreBasedDatabase
New-AzSqlDatabase
[-ServerName] <String>
[-ResourceGroupName] <String>
-DatabaseName <String>
-Edition <String>
-VCore <Int32>
-ComputeGeneration <String>
[-CollationName <String>]
[-CatalogCollation <String>]
[-MaxSizeBytes <Int64>]
[-ReadScale <DatabaseReadScale>]
[-Tags <Hashtable>]
[-SampleName <String>]
[-ZoneRedundant]
[-AsJob]
[-Force]
[-LicenseType <String>]
[-ComputeModel <String>]
[-AutoPauseDelayInMinutes <Int32>]
[-MinimumCapacity <Double>]
[-HighAvailabilityReplicaCount <Int32>]
[-BackupStorageRedundancy <String>]
[-SecondaryType <String>]
[-MaintenanceConfigurationId <String>]
[-EnableLedger]
[-PreferredEnclaveType <String>]
[-AssignIdentity]
[-EncryptionProtector <String>]
[-UserAssignedIdentityId <String[]>]
[-KeyList <String[]>]
[-FederatedClientId <Guid>]
[-EncryptionProtectorAutoRotation]
[-UseFreeLimit]
[-FreeLimitExhaustionBehavior <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-AzSqlDatabase cmdlet creates an Azure SQL database. You can also create an elastic database by setting the ElasticPoolName parameter to an existing elastic pool.
Examples Example 1: Create a database on a specified serverNew-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database01"
ResourceGroupName : ResourceGroup01
ServerName : Server01
DatabaseName : Database01
Location : Central US
DatabaseId : a1e6bd1a-735a-4d48-8b98-afead5ef1218
Edition : Standard
CollationName : SQL_Latin1_General_CP1_CI_AS
CatalogCollation :
MaxSizeBytes : 268435456000
Status : Online
CreationDate : 7/3/2015 7:33:37 AM
CurrentServiceObjectiveId : f1173c43-91bd-4aaa-973c-54e79e15235b
CurrentServiceObjectiveName : S0
RequestedServiceObjectiveId : f1173c43-91bd-4aaa-973c-54e79e15235b
RequestedServiceObjectiveName :
ElasticPoolName :
EarliestRestoreDate :
LicenseType :
Tags :
EnableLedger : False
This command creates a database named Database01 on server Server01.
Example 2: Create an elastic database on a specified serverNew-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database02" -ElasticPoolName "ElasticPool01"
ResourceGroupName : ResourceGroup01
ServerName : Server01
DatabaseName : Database02
Location : Central US
DatabaseId : 7bd9d561-42a7-484e-bf05-62ddef8015ab
Edition : Standard
CollationName : SQL_Latin1_General_CP1_CI_AS
CatalogCollation :
MaxSizeBytes : 268435456000
Status : Online
CreationDate : 8/26/2015 10:04:29 PM
CurrentServiceObjectiveId : d1737d22-a8ea-4de7-9bd0-33395d2a7419
CurrentServiceObjectiveName : ElasticPool
RequestedServiceObjectiveId : d1737d22-a8ea-4de7-9bd0-33395d2a7419
RequestedServiceObjectiveName :
ElasticPoolName : ElasticPool01
EarliestRestoreDate :
LicenseType :
Tags :
EnableLedger : False
This command creates a database named Database02 in the elastic pool named ElasticPool01 on server Server01.
Example 3: Create an Vcore database on a specified serverNew-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database03" -Edition "GeneralPurpose" -Vcore 2 -ComputeGeneration "Gen4"
ResourceGroupName : ResourceGroup01
ServerName : Server01
DatabaseName : Database03
Location : Central US
DatabaseId : 34d9d561-42a7-484e-bf05-62ddef8000ab
Edition : GeneralPurpose
CollationName : SQL_Latin1_General_CP1_CI_AS
CatalogCollation :
MaxSizeBytes : 268435456000
Status : Online
CreationDate : 8/26/2015 10:04:29 PM
CurrentServiceObjectiveName : GP_Gen4_2
RequestedServiceObjectiveName :
ElasticPoolName :
EarliestRestoreDate :
LicenseType : LicenseIncluded
Tags :
EnableLedger : False
This command creates a Vcore database named Database03 on server Server01.
Example 4: Create an Serverless database on the specified serverNew-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database04" -Edition "GeneralPurpose" -Vcore 2 -ComputeGeneration "Gen5" -ComputeModel Serverless
ResourceGroupName : ResourceGroup01
ServerName : Server01
DatabaseName : Database04
Location : Central US
DatabaseId : ef5a9698-012c-4def-8d94-7f6bfb7b4f04
Edition : GeneralPurpose
CollationName : SQL_Latin1_General_CP1_CI_AS
CatalogCollation :
MaxSizeBytes : 34359738368
Status : Online
CreationDate : 4/12/2019 11:20:29 PM
CurrentServiceObjectiveName : GP_S_Gen5_2
RequestedServiceObjectiveName : GP_S_Gen5_2
ElasticPoolName :
EarliestRestoreDate : 4/12/2019 11:50:29 PM
Tags :
CreateMode :
ReadScale : Disabled
ZoneRedundant : False
Capacity : 2
Family : Gen5
SkuName : GP_S_Gen5
LicenseType : LicenseIncluded
AutoPauseDelayInMinutes : 360
EnableLedger : False
MinimumCapacity : 0.5
This command creates a Serverless database named Database04 on server Server01.
Example 5: Create a database configured with preferred enclave type as VBSNew-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -DatabaseName "Database01" -ServerName "Server01" -Edition "GeneralPurpose" -Vcore 2 -ComputeGeneration "Gen5" -PreferredEnclaveType "VBS"
ResourceGroupName : ResourceGroup01
ServerName : Server01
DatabaseName : Database01
Location : Central US
DatabaseId : 34d9d561-42a7-484e-bf05-62ddef8000ab
Edition : GeneralPurpose
CollationName : SQL_Latin1_General_CP1_CI_AS
CatalogCollation :
MaxSizeBytes : 268435456000
Status : Online
CreationDate : 8/26/2015 10:04:29 PM
CurrentServiceObjectiveName : GP_Gen5_2
RequestedServiceObjectiveName :
ElasticPoolName :
EarliestRestoreDate :
LicenseType : LicenseIncluded
Tags :
EnableLedger : False
PreferredEnclaveType : VBS
This command creates a database configured with VBS enclave
Parameters -AsJobRun 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 -AssignIdentityGenerate and assign a Microsoft Entra identity for this database 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 -AutoPauseDelayInMinutesThe auto pause delay in minutes for database(serverless only), -1 to opt out
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 -BackupStorageRedundancyThe Backup storage redundancy used to store backups for the SQL Database. 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 -CatalogCollationSpecifies the name of the SQL database catalog collation.
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 -CollationNameSpecifies the name of the SQL database collation.
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 -ComputeGenerationThe compute generation to assign.
Parameter properties Type: String Default value: None Supports wildcards: False DontShow: False Aliases: Family Parameter sets VcoreBasedDatabase Position: Named Mandatory: True Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -ComputeModelThe compute model for Azure Sql database. Serverless or Provisioned
Parameter properties Type: String Default value: None Supports wildcards: False DontShow: False Parameter sets VcoreBasedDatabase Position: Named Mandatory: False Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -ConfirmPrompts you for confirmation before running the cmdlet.
Parameter properties Type: SwitchParameter Default value: False 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 -DatabaseNameSpecifies the name of the database.
Parameter properties Type: String Default value: None Supports wildcards: False DontShow: False Aliases: Name Parameter sets (All) Position: Named Mandatory: True Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -DefaultProfileThe 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 -EditionSpecifies the edition to assign to the database. The acceptable values for this parameter are:
Specifies the name of the elastic pool in which to put the database.
Parameter properties Type: String Default value: None Supports wildcards: False DontShow: False Parameter sets DtuBasedDatabase Position: Named Mandatory: False Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -EnableLedgerCreates 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 Parameter sets (All) Position: Named Mandatory: False Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -EncryptionProtectorThe encryption protector key for SQL Database.
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 -EncryptionProtectorAutoRotationThe AKV Key Auto Rotation status
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: True Value from remaining arguments: False -FederatedClientIdThe federated client id for the SQL Database. It is used for cross tenant CMK scenario.
Parameter properties Type: 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 -ForceSkip 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 -FreeLimitExhaustionBehaviorExhaustion behavior of free limit database.
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 -HighAvailabilityReplicaCountThe number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases.
Parameter properties Type: Int32 Default value: None Supports wildcards: False DontShow: False Aliases: ReadReplicaCount Parameter sets (All) Position: Named Mandatory: False Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -KeyListThe list of AKV keys for the SQL Database.
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 -LicenseTypeThe license type for the Azure Sql database. Possible values are:
The Maintenance configuration id for the SQL Database.
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 -MaxSizeBytesSpecifies the maximum size of the database in bytes.
Parameter properties Type: Int64 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 -MinimumCapacityThe Minimal capacity that database will always have allocated, if not paused. For serverless Azure Sql databases only.
Parameter properties Type: Double Default value: None Supports wildcards: False DontShow: False Aliases: MinVCore, MinCapacity Parameter sets (All) Position: Named Mandatory: False Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -PreferredEnclaveTypeThe preferred enclave type for the Azure Sql database. Possible values are Default and VBS.
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 -ReadScaleIf enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases.
Parameter properties Type: DatabaseReadScale Default value: None Accepted values: Disabled, Enabled 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 -RequestedServiceObjectiveNameSpecifies the name of the service objective to assign to the database.
Parameter properties Type: String Default value: None Supports wildcards: False DontShow: False Parameter sets DtuBasedDatabase Position: Named Mandatory: False Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -ResourceGroupNameSpecifies the name of the resource group to which the server is assigned.
Parameter properties Type: String Default value: None Supports wildcards: False DontShow: False Parameter sets (All) Position: 0 Mandatory: True Value from pipeline: False Value from pipeline by property name: True Value from remaining arguments: False -SampleNameThe name of the sample schema to apply when creating this database.
Parameter properties Type: String Default value: None Accepted values: AdventureWorksLT 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 -SecondaryTypeThe secondary type of the database if it is a secondary. Valid values are Geo and Named.
Parameter properties Type: String Default value: None Accepted values: Named, Geo 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 -ServerNameSpecifies the name of the server that hosts the database.
Parameter properties Type: String Default value: None Supports wildcards: False DontShow: False Parameter sets (All) Position: 1 Mandatory: True Value from pipeline: False Value from pipeline by property name: True Value from remaining arguments: False -TagsSpecifies a dictionary of Key-value pairs in the form of a hash table that this cmdlet associates with the new database. For example: @{key0="value0";key1=$null;key2="value2"}
Parameter properties Type: Hashtable Default value: None Supports wildcards: False DontShow: False Aliases: Tag Parameter sets (All) Position: Named Mandatory: False Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -UseFreeLimitUse free limit on this database.
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 -UserAssignedIdentityIdThe list of user assigned identity for the SQL Database.
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 -VCoreThe Vcore number for the Azure Sql database
Parameter properties Type: Int32 Default value: None Supports wildcards: False DontShow: False Aliases: Capacity, MaxVCore, MaxCapacity Parameter sets VcoreBasedDatabase Position: Named Mandatory: True Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties Type: SwitchParameter Default value: False 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 -ZoneRedundantThe zone redundancy to associate with the Azure Sql Database
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 CommonParametersThis 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 String Outputs AzureSqlDatabaseModelRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4