Share via


SqlDatabase Class

Definition

SqlDatabase.

public class SqlDatabase : Azure.Provisioning.Primitives.ProvisionableResource
public class SqlDatabase : Azure.Provisioning.Primitives.Resource
type SqlDatabase = class
    inherit ProvisionableResource
type SqlDatabase = class
    inherit Resource
Public Class SqlDatabase
Inherits ProvisionableResource
Public Class SqlDatabase
Inherits Resource
Inheritance
Inheritance

Constructors

SqlDatabase(String, String)

Creates a new SqlDatabase.

Properties

AutoPauseDelay

Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled.

AvailabilityZone

Specifies the availability zone the database is pinned to.

BicepIdentifier

Gets or sets the the Bicep identifier name of the resource. This can be used to refer to the resource in expressions, but is not the Azure name of the resource. This value can contain letters, numbers, and underscores.

(Inherited from NamedProvisionableConstruct)
CatalogCollation

Collation of the metadata catalog.

Collation

The collation of the database.

CreatedOn

The creation date of the database (ISO8601 format).

CreateMode

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.

CurrentBackupStorageRedundancy

The storage account type used to store backups for this database.

CurrentServiceObjectiveName

The current service level objective name of the database.

CurrentSku

The name and tier of the SKU.

DatabaseId

The ID of the database.

DefaultSecondaryLocation

The default secondary region for this database.

DependsOn

Declares explicit dependencies on other resources.

(Inherited from ProvisionableResource)
DependsOn

Declares explicit dependencies on other resources.

(Inherited from Resource)
EarliestRestoreOn

This records the earliest start date and time that restore is available for this database (ISO8601 format).

ElasticPoolId

The resource identifier of the elastic pool containing this database.

EncryptionProtector

The azure key vault URI of the database if it's configured with per Database Customer Managed Keys.

EncryptionProtectorAutoRotation

The flag to enable or disable auto rotation of database encryption protector AKV key.

FailoverGroupId

Failover Group resource identifier that this database belongs to.

FederatedClientId

The Client id used for cross tenant per database CMK scenario.

FreeLimitExhaustionBehavior

Specifies the behavior when monthly free limits are exhausted for the free database. AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the month. BillForUsage: The database will continue to be online upon exhaustion of free limits and any overage will be billed.

HighAvailabilityReplicaCount

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.

Id

Gets the Id.

IdentifierName

Gets or sets the the Bicep identifier name of the resource. This can be used to refer to the resource in expressions, but is not the Azure name of the resource. This value can contain letters, numbers, and underscores.

(Inherited from NamedProvisioningConstruct)
Identity

The Azure Active Directory identity of the database.

IsExistingResource

Gets whether this is referencing an existing resource or we're defining a new resource.

(Inherited from ProvisionableResource)
IsExistingResource

Gets whether this is referencing an existing resource or we're defining a new resource.

(Inherited from Resource)
IsInfraEncryptionEnabled

Infra encryption is enabled for this database.

IsLedgerOn

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.

IsZoneRedundant

Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.

Keys

The resource ids of the user assigned identities to use.

Kind

Kind of database. This is metadata used for the Azure portal experience.

LicenseType

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.

Location

Gets or sets the Location.

LongTermRetentionBackupResourceId

The resource identifier of the long term retention backup associated with create operation of this database.

MaintenanceConfigurationId

Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.

ManagedBy

Resource that manages the database.

ManualCutover

Whether or not customer controlled manual cutover needs to be done during Update Database operation to Hyperscale tier. This property is only applicable when scaling database from Business Critical/General Purpose/Premium/Standard tier to Hyperscale tier. When manualCutover is specified, the scaling operation will wait for user input to trigger cutover to Hyperscale database. To trigger cutover, please provide 'performCutover' parameter when the Scaling operation is in Waiting state.

MaxLogSizeBytes

The max log size for this database.

MaxSizeBytes

The max size of the database expressed in bytes.

MinCapacity

Minimal capacity that database will always have allocated, if not paused.

Name

The name of the database.

Parent

Gets or sets a reference to the parent SqlServer.

PausedOn

The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready.

PerformCutover

To trigger customer controlled manual cutover during the wait state while Scaling operation is in progress. This property parameter is only applicable for scaling operations that are initiated along with 'manualCutover' parameter. This property is only applicable when scaling database from Business Critical/General Purpose/Premium/Standard tier to Hyperscale tier is already in progress. When performCutover is specified, the scaling operation will trigger cutover and perform role-change to Hyperscale database.

PreferredEnclaveType

Type of enclave requested on the database i.e. Default or VBS enclaves.

ReadScale

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.

RecoverableDatabaseId

The resource identifier of the recoverable database associated with create operation of this database.

RecoveryServicesRecoveryPointId

The resource identifier of the recovery point associated with create operation of this database.

RequestedBackupStorageRedundancy

The storage account type to be used to store backups for this database.

RequestedServiceObjectiveName

The requested service level objective name of the database.

ResourceType

Gets the type of the resource.

(Inherited from ProvisionableResource)
ResourceType

Gets the type of the resource.

(Inherited from Resource)
ResourceVersion

Gets or sets the version of the resource.

(Inherited from ProvisionableResource)
ResourceVersion

Gets or sets the version of the resource.

(Inherited from Resource)
RestorableDroppedDatabaseId

The resource identifier of the restorable dropped database associated with create operation of this database.

RestorePointInTime

Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.

ResumedOn

The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused.

SampleName

The name of the sample schema to apply when creating this database.

SecondaryType

The secondary type of the database if it is a secondary. Valid values are Geo, Named and Standby.

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:

list-editions -l <location> -o table              ````
```powershell
Get-AzSqlServerServiceObjective -Location
<location>              ````
SourceDatabaseDeletedOn

Specifies the time that the database was deleted.

SourceDatabaseId

The resource identifier of the source database associated with create operation of this database.

SourceResourceId

The resource identifier of the source associated with the create operation of this database. This property is only supported for DataWarehouse edition and allows to restore across subscriptions. 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 the 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. 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

Status

The status of the database.

SystemData

Gets the SystemData.

Tags

Gets or sets the Tags.

UseFreeLimit

Whether or not the database uses free monthly limits. Allowed on one database in a subscription.

Methods

AssignOrReplace<T>(T, T) (Inherited from ProvisionableConstruct)
Build(ProvisioningBuildOptions)

Compose the resource into a provisioning plan that can be saved as Bicep or deployed directly.

(Inherited from ProvisionableResource)
Build(ProvisioningContext)

Compose the resource into a provisioning plan that can be saved as Bicep or deployed directly.

(Inherited from Resource)
Compile()

Compile the resource into a set of Bicep statements.

(Inherited from ProvisionableResource)
Compile()

Compile the resource into a set of Bicep statements.

(Inherited from Resource)
DefineDictionaryProperty<T>(String, String[], Boolean, Boolean) (Inherited from ProvisionableConstruct)
DefineListProperty<T>(String, String[], Boolean, Boolean) (Inherited from ProvisionableConstruct)
DefineModelProperty<T>(String, String[], Boolean, Boolean, Boolean, String) (Inherited from ProvisionableConstruct)
DefineProperty<T>(String, String[], Boolean, Boolean, Boolean, BicepValue<T>, String) (Inherited from ProvisionableConstruct)
DefineProvisionableProperties()

Define all the provisionable properties of SqlDatabase.

DefineResource<T>(String, String[], Boolean, Boolean, T) (Inherited from ProvisionableResource)
FromExisting(String, String)

Creates a reference to an existing SqlDatabase.

GetProvisionableResources()

Get any resources represented by this object. This will typically only be the object itself for everything but Infrastructure.

(Inherited from Provisionable)
GetResources()

Get any resources represented by this object. This will typically only be the object itself for everything but Infrastructure.

(Inherited from Provisionable)
Initialize()

Initialize this construct.

(Inherited from ProvisionableConstruct)
OverrideWithExpression(BicepExpression) (Inherited from ProvisionableConstruct)
OverrideWithExpression(Expression)

Set this construct to represent the result of an expression. This is primarily meant to be called via FromExpression static methods on specific resources or constructs.

(Inherited from ProvisioningConstruct)
Resolve(ProvisioningBuildOptions)

Resolve any resources or properties that were not explicitly specified.

(Inherited from ProvisionableConstruct)
Resolve(ProvisioningBuildOptions)

Resolve any resources or properties that were not explicitly specified.

(Inherited from Provisionable)
Resolve(ProvisioningContext)

Resolve any resources or properties that were not explicitly specified.

(Inherited from Provisionable)
Resolve(ProvisioningContext)

Resolve any resources or properties that were not explicitly specified.

(Inherited from ProvisioningConstruct)
Validate(ProvisioningBuildOptions)

Validate the presence of any required members.

(Inherited from ProvisionableResource)
Validate(ProvisioningBuildOptions)

Validate the presence of any required members.

(Inherited from Provisionable)
Validate(ProvisioningContext)

Validate the presence of any required members.

(Inherited from Provisionable)
Validate(ProvisioningContext)

Validate the presence of any required members.

(Inherited from Resource)

Explicit Interface Implementations

IBicepValue.Assign(IBicepValue)

Assign a value to this property.

(Inherited from ProvisionableConstruct)
IBicepValue.Compile()

Compile this value to a Bicep expression.

(Inherited from ProvisionableConstruct)
IBicepValue.Expression

Gets the expression for this value if it's not a literal.

(Inherited from ProvisionableConstruct)
IBicepValue.IsEmpty

Gets whether this value is unset or empty.

(Inherited from ProvisionableConstruct)
IBicepValue.IsOutput

Tracks whether this is an output only property.

(Inherited from ProvisionableConstruct)
IBicepValue.IsRequired

Tracks whether this property is required.

(Inherited from ProvisionableConstruct)
IBicepValue.IsSecure

Tracks whether this contains a secure value.

(Inherited from ProvisionableConstruct)
IBicepValue.Kind

Gets the kind of this value (a literal value, an expression, or it's unset).

(Inherited from ProvisionableConstruct)
IBicepValue.LiteralValue

Get the value of this expression, if it's literal.

(Inherited from ProvisionableConstruct)
IBicepValue.Self

Gets information about where this value was defined.

(Inherited from ProvisionableConstruct)
IBicepValue.SetReadOnly()

Make this value readonly.

(Inherited from ProvisionableConstruct)
IBicepValue.Source

Gets information about where this value was assigned from.

(Inherited from ProvisionableConstruct)

Applies to