Database Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Database()
Initializes a new instance of the Database class.
public Database ();
Public Sub New ()
Applies to
Database(String, String, String, String, IDictionary<String,String>, Sku, String, String, DatabaseIdentity, String, String, Nullable<Int64>, String, String, String, String, Nullable<Guid>, Nullable<DateTime>, String, String, String, String, Nullable<DateTime>, Nullable<DateTime>, String, String, String, String, String, Nullable<Boolean>, String, Nullable<Int64>, Nullable<DateTime>, String, Nullable<Int32>, String, Sku, Nullable<Int32>, String, String, Nullable<Double>, Nullable<DateTime>, Nullable<DateTime>, String, Nullable<Boolean>, Nullable<Boolean>, Nullable<Guid>, String)
Initializes a new instance of the Database class.
public Database (string location, string id = default, string name = default, string type = default, System.Collections.Generic.IDictionary<string,string> tags = default, Microsoft.Azure.Management.Sql.Models.Sku sku = default, string kind = default, string managedBy = default, Microsoft.Azure.Management.Sql.Models.DatabaseIdentity identity = default, string createMode = default, string collation = default, long? maxSizeBytes = default, string sampleName = default, string elasticPoolId = default, string sourceDatabaseId = default, string status = default, Guid? databaseId = default, DateTime? creationDate = default, string currentServiceObjectiveName = default, string requestedServiceObjectiveName = default, string defaultSecondaryLocation = default, string failoverGroupId = default, DateTime? restorePointInTime = default, DateTime? sourceDatabaseDeletionDate = default, string recoveryServicesRecoveryPointId = default, string longTermRetentionBackupResourceId = default, string recoverableDatabaseId = default, string restorableDroppedDatabaseId = default, string catalogCollation = default, bool? zoneRedundant = default, string licenseType = default, long? maxLogSizeBytes = default, DateTime? earliestRestoreDate = default, string readScale = default, int? highAvailabilityReplicaCount = default, string secondaryType = default, Microsoft.Azure.Management.Sql.Models.Sku currentSku = default, int? autoPauseDelay = default, string currentBackupStorageRedundancy = default, string requestedBackupStorageRedundancy = default, double? minCapacity = default, DateTime? pausedDate = default, DateTime? resumedDate = default, string maintenanceConfigurationId = default, bool? isLedgerOn = default, bool? isInfraEncryptionEnabled = default, Guid? federatedClientId = default, string sourceResourceId = default);
new Microsoft.Azure.Management.Sql.Models.Database : string * string * string * string * System.Collections.Generic.IDictionary<string, string> * Microsoft.Azure.Management.Sql.Models.Sku * string * string * Microsoft.Azure.Management.Sql.Models.DatabaseIdentity * string * string * Nullable<int64> * string * string * string * string * Nullable<Guid> * Nullable<DateTime> * string * string * string * string * Nullable<DateTime> * Nullable<DateTime> * string * string * string * string * string * Nullable<bool> * string * Nullable<int64> * Nullable<DateTime> * string * Nullable<int> * string * Microsoft.Azure.Management.Sql.Models.Sku * Nullable<int> * string * string * Nullable<double> * Nullable<DateTime> * Nullable<DateTime> * string * Nullable<bool> * Nullable<bool> * Nullable<Guid> * string -> Microsoft.Azure.Management.Sql.Models.Database
Public Sub New (location As String, Optional id As String = Nothing, Optional name As String = Nothing, Optional type As String = Nothing, Optional tags As IDictionary(Of String, String) = Nothing, Optional sku As Sku = Nothing, Optional kind As String = Nothing, Optional managedBy As String = Nothing, Optional identity As DatabaseIdentity = Nothing, Optional createMode As String = Nothing, Optional collation As String = Nothing, Optional maxSizeBytes As Nullable(Of Long) = Nothing, Optional sampleName As String = Nothing, Optional elasticPoolId As String = Nothing, Optional sourceDatabaseId As String = Nothing, Optional status As String = Nothing, Optional databaseId As Nullable(Of Guid) = Nothing, Optional creationDate As Nullable(Of DateTime) = Nothing, Optional currentServiceObjectiveName As String = Nothing, Optional requestedServiceObjectiveName As String = Nothing, Optional defaultSecondaryLocation As String = Nothing, Optional failoverGroupId As String = Nothing, Optional restorePointInTime As Nullable(Of DateTime) = Nothing, Optional sourceDatabaseDeletionDate As Nullable(Of DateTime) = Nothing, Optional recoveryServicesRecoveryPointId As String = Nothing, Optional longTermRetentionBackupResourceId As String = Nothing, Optional recoverableDatabaseId As String = Nothing, Optional restorableDroppedDatabaseId As String = Nothing, Optional catalogCollation As String = Nothing, Optional zoneRedundant As Nullable(Of Boolean) = Nothing, Optional licenseType As String = Nothing, Optional maxLogSizeBytes As Nullable(Of Long) = Nothing, Optional earliestRestoreDate As Nullable(Of DateTime) = Nothing, Optional readScale As String = Nothing, Optional highAvailabilityReplicaCount As Nullable(Of Integer) = Nothing, Optional secondaryType As String = Nothing, Optional currentSku As Sku = Nothing, Optional autoPauseDelay As Nullable(Of Integer) = Nothing, Optional currentBackupStorageRedundancy As String = Nothing, Optional requestedBackupStorageRedundancy As String = Nothing, Optional minCapacity As Nullable(Of Double) = Nothing, Optional pausedDate As Nullable(Of DateTime) = Nothing, Optional resumedDate As Nullable(Of DateTime) = Nothing, Optional maintenanceConfigurationId As String = Nothing, Optional isLedgerOn As Nullable(Of Boolean) = Nothing, Optional isInfraEncryptionEnabled As Nullable(Of Boolean) = Nothing, Optional federatedClientId As Nullable(Of Guid) = Nothing, Optional sourceResourceId As String = Nothing)
Parameters
- location
- String
Resource location.
- id
- String
Resource ID.
- name
- String
Resource name.
- type
- String
Resource type.
- tags
- IDictionary<String,String>
Resource tags.
- sku
- Sku
The database SKU.
The list of SKUs may vary by region and support offer. To determine
the SKUs (including the SKU name, tier/edition, family, and
capacity) that are available to your subscription in an Azure
region, use the `Capabilities_ListByLocation` REST API or one of
the following commands:
```azurecli
az sql db list-editions -l <location> -o table
````
```powershell
Get-AzSqlServerServiceObjective -Location <location>
````
- kind
- String
Kind of database. This is metadata used for the Azure portal experience.
- managedBy
- String
Resource that manages the database.
- identity
- DatabaseIdentity
The Azure Active Directory identity of the database.
- createMode
- String
Specifies the mode of database creation.
Default: regular database creation.
Copy: creates a database as a copy of an existing database.
sourceDatabaseId must be specified as the resource ID of the source
database.
Secondary: creates a database as a secondary replica of an existing
database. sourceDatabaseId must be specified as the resource ID of
the existing primary database.
PointInTimeRestore: Creates a database by restoring a point in time
backup of an existing database. sourceDatabaseId must be specified
as the resource ID of the existing database, and restorePointInTime
must be specified.
Recovery: Creates a database by restoring a geo-replicated backup.
sourceDatabaseId must be specified as the recoverable database
resource ID to restore.
Restore: Creates a database by restoring a backup of a deleted
database. sourceDatabaseId must be specified. If sourceDatabaseId
is the database's original resource ID, then
sourceDatabaseDeletionDate must be specified. Otherwise
sourceDatabaseId must be the restorable dropped database resource
ID and sourceDatabaseDeletionDate is ignored. restorePointInTime
may also be specified to restore from an earlier point in time.
RestoreLongTermRetentionBackup: Creates a database by restoring
from a long term retention vault.
recoveryServicesRecoveryPointResourceId must be specified as the
recovery point resource ID.
Copy, Secondary, and RestoreLongTermRetentionBackup are not
supported for DataWarehouse edition. Possible values include:
'Default', 'Copy', 'Secondary', 'PointInTimeRestore', 'Restore',
'Recovery', 'RestoreExternalBackup',
'RestoreExternalBackupSecondary', 'RestoreLongTermRetentionBackup',
'OnlineSecondary'
- collation
- String
The collation of the database.
- sampleName
- String
The name of the sample schema to apply when creating this database. Possible values include: 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull'
- elasticPoolId
- String
The resource identifier of the elastic pool containing this database.
- sourceDatabaseId
- String
The resource identifier of the source database associated with create operation of this database.
- status
- String
The status of the database. Possible values include: 'Online', 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', 'Offline', 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', 'Copying', 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', 'Paused', 'Resuming', 'Scaling', 'OfflineChangingDwPerformanceTiers', 'OnlineChangingDwPerformanceTiers', 'Disabled', 'Stopping', 'Stopped', 'Starting'
- currentServiceObjectiveName
- String
The current service level objective name of the database.
- requestedServiceObjectiveName
- String
The requested service level objective name of the database.
- defaultSecondaryLocation
- String
The default secondary region for this database.
- failoverGroupId
- String
Failover Group resource identifier that this database belongs to.
Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
- recoveryServicesRecoveryPointId
- String
The resource identifier of the recovery point associated with create operation of this database.
- longTermRetentionBackupResourceId
- String
The resource identifier of the long term retention backup associated with create operation of this database.
- recoverableDatabaseId
- String
The resource identifier of the recoverable database associated with create operation of this database.
- restorableDroppedDatabaseId
- String
The resource identifier of the restorable dropped database associated with create operation of this database.
- catalogCollation
- String
Collation of the metadata catalog. Possible values include: 'DATABASE_DEFAULT', 'SQL_Latin1_General_CP1_CI_AS'
Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
- licenseType
- String
The license type to apply for this
database. LicenseIncluded
if you need a license, or BasePrice
if you have a license and are eligible for the Azure Hybrid
Benefit. Possible values include: 'LicenseIncluded',
'BasePrice'
This records the earliest start date and time that restore is available for this database (ISO8601 format).
- readScale
- String
The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Not applicable to a Hyperscale database within an elastic pool. Possible values include: 'Enabled', 'Disabled'
The number of secondary replicas associated with the database that are used to provide high availability. Not applicable to a Hyperscale database within an elastic pool.
- secondaryType
- String
The secondary type of the database if it is a secondary. Valid values are Geo and Named. Possible values include: 'Geo', 'Named'
- currentSku
- Sku
The name and tier of the SKU.
Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled
- currentBackupStorageRedundancy
- String
The storage account type used to store backups for this database. Possible values include: 'Geo', 'Local', 'Zone', 'GeoZone'
- requestedBackupStorageRedundancy
- String
The storage account type to be used to store backups for this database. Possible values include: 'Geo', 'Local', 'Zone', 'GeoZone'
Minimal capacity that database will always have allocated, if not paused
The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready.
The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused.
- maintenanceConfigurationId
- String
Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.
Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the value of this property cannot be changed after the database has been created.
- sourceResourceId
- String
The resource identifier of the source associated with the create operation of this database.
When sourceResourceId is specified, sourceDatabaseId,
recoverableDatabaseId, restorableDroppedDatabaseId and
sourceDatabaseDeletionDate must not be specified and CreateMode
must be PointInTimeRestore, Restore or Recover.
When createMode is PointInTimeRestore, sourceResourceId must be the
resource ID of an existing database or existing sql pool, and
restorePointInTime must be specified.
When createMode is Restore, sourceResourceId must be the resource
ID of restorable dropped database or restorable dropped sql pool.
When createMode is Recover, sourceResourceId must be the resource
ID of recoverable database or recoverable sql pool.
This property allows to restore across subscriptions which is only
supported for DataWarehouse edition.
When source subscription belongs to a different tenant than target
subscription, “x-ms-authorization-auxiliary” header must contain
authentication token for the source tenant. For more details about
“x-ms-authorization-auxiliary” header see
https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant