你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ArmSqlModelFactory.SqlDatabaseData 方法

定义

初始化 SqlDatabaseData 的新实例。

public static Azure.ResourceManager.Sql.SqlDatabaseData SqlDatabaseData (Azure.Core.ResourceIdentifier id = default, string name = default, Azure.Core.ResourceType resourceType = default, Azure.ResourceManager.Models.SystemData systemData = default, System.Collections.Generic.IDictionary<string,string> tags = default, Azure.Core.AzureLocation location = default, Azure.ResourceManager.Sql.Models.SqlSku sku = default, string kind = default, string managedBy = default, Azure.ResourceManager.Sql.Models.DatabaseIdentity identity = default, Azure.ResourceManager.Sql.Models.SqlDatabaseCreateMode? createMode = default, string collation = default, long? maxSizeBytes = default, Azure.ResourceManager.Sql.Models.SampleSchemaName? sampleName = default, Azure.Core.ResourceIdentifier elasticPoolId = default, Azure.Core.ResourceIdentifier sourceDatabaseId = default, Azure.ResourceManager.Sql.Models.SqlDatabaseStatus? status = default, Guid? databaseId = default, DateTimeOffset? createdOn = default, string currentServiceObjectiveName = default, string requestedServiceObjectiveName = default, Azure.Core.AzureLocation? defaultSecondaryLocation = default, Azure.Core.ResourceIdentifier failoverGroupId = default, DateTimeOffset? restorePointInTime = default, DateTimeOffset? sourceDatabaseDeletedOn = default, Azure.Core.ResourceIdentifier recoveryServicesRecoveryPointId = default, Azure.Core.ResourceIdentifier longTermRetentionBackupResourceId = default, Azure.Core.ResourceIdentifier recoverableDatabaseId = default, Azure.Core.ResourceIdentifier restorableDroppedDatabaseId = default, Azure.ResourceManager.Sql.Models.CatalogCollationType? catalogCollation = default, bool? isZoneRedundant = default, Azure.ResourceManager.Sql.Models.DatabaseLicenseType? licenseType = default, long? maxLogSizeBytes = default, DateTimeOffset? earliestRestoreOn = default, Azure.ResourceManager.Sql.Models.DatabaseReadScale? readScale = default, int? highAvailabilityReplicaCount = default, Azure.ResourceManager.Sql.Models.SecondaryType? secondaryType = default, Azure.ResourceManager.Sql.Models.SqlSku currentSku = default, int? autoPauseDelay = default, Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? currentBackupStorageRedundancy = default, Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? requestedBackupStorageRedundancy = default, double? minCapacity = default, DateTimeOffset? pausedOn = default, DateTimeOffset? resumedOn = default, Azure.Core.ResourceIdentifier maintenanceConfigurationId = default, bool? isLedgerOn = default, bool? isInfraEncryptionEnabled = default, Guid? federatedClientId = default, System.Collections.Generic.IDictionary<string,Azure.ResourceManager.Sql.Models.SqlDatabaseKey> keys = default, string encryptionProtector = default, Azure.ResourceManager.Sql.Models.SqlAlwaysEncryptedEnclaveType? preferredEnclaveType = default, bool? useFreeLimit = default, Azure.ResourceManager.Sql.Models.FreeLimitExhaustionBehavior? freeLimitExhaustionBehavior = default, Azure.Core.ResourceIdentifier sourceResourceId = default, bool? manualCutover = default, bool? performCutover = default, Azure.ResourceManager.Sql.Models.SqlAvailabilityZoneType? availabilityZone = default, bool? encryptionProtectorAutoRotation = default);
static member SqlDatabaseData : Azure.Core.ResourceIdentifier * string * Azure.Core.ResourceType * Azure.ResourceManager.Models.SystemData * System.Collections.Generic.IDictionary<string, string> * Azure.Core.AzureLocation * Azure.ResourceManager.Sql.Models.SqlSku * string * string * Azure.ResourceManager.Sql.Models.DatabaseIdentity * Nullable<Azure.ResourceManager.Sql.Models.SqlDatabaseCreateMode> * string * Nullable<int64> * Nullable<Azure.ResourceManager.Sql.Models.SampleSchemaName> * Azure.Core.ResourceIdentifier * Azure.Core.ResourceIdentifier * Nullable<Azure.ResourceManager.Sql.Models.SqlDatabaseStatus> * Nullable<Guid> * Nullable<DateTimeOffset> * string * string * Nullable<Azure.Core.AzureLocation> * Azure.Core.ResourceIdentifier * Nullable<DateTimeOffset> * Nullable<DateTimeOffset> * Azure.Core.ResourceIdentifier * Azure.Core.ResourceIdentifier * Azure.Core.ResourceIdentifier * Azure.Core.ResourceIdentifier * Nullable<Azure.ResourceManager.Sql.Models.CatalogCollationType> * Nullable<bool> * Nullable<Azure.ResourceManager.Sql.Models.DatabaseLicenseType> * Nullable<int64> * Nullable<DateTimeOffset> * Nullable<Azure.ResourceManager.Sql.Models.DatabaseReadScale> * Nullable<int> * Nullable<Azure.ResourceManager.Sql.Models.SecondaryType> * Azure.ResourceManager.Sql.Models.SqlSku * Nullable<int> * Nullable<Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy> * Nullable<Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy> * Nullable<double> * Nullable<DateTimeOffset> * Nullable<DateTimeOffset> * Azure.Core.ResourceIdentifier * Nullable<bool> * Nullable<bool> * Nullable<Guid> * System.Collections.Generic.IDictionary<string, Azure.ResourceManager.Sql.Models.SqlDatabaseKey> * string * Nullable<Azure.ResourceManager.Sql.Models.SqlAlwaysEncryptedEnclaveType> * Nullable<bool> * Nullable<Azure.ResourceManager.Sql.Models.FreeLimitExhaustionBehavior> * Azure.Core.ResourceIdentifier * Nullable<bool> * Nullable<bool> * Nullable<Azure.ResourceManager.Sql.Models.SqlAvailabilityZoneType> * Nullable<bool> -> Azure.ResourceManager.Sql.SqlDatabaseData
Public Shared Function SqlDatabaseData (Optional id As ResourceIdentifier = Nothing, Optional name As String = Nothing, Optional resourceType As ResourceType = Nothing, Optional systemData As SystemData = Nothing, Optional tags As IDictionary(Of String, String) = Nothing, Optional location As AzureLocation = Nothing, Optional sku As SqlSku = Nothing, Optional kind As String = Nothing, Optional managedBy As String = Nothing, Optional identity As DatabaseIdentity = Nothing, Optional createMode As Nullable(Of SqlDatabaseCreateMode) = Nothing, Optional collation As String = Nothing, Optional maxSizeBytes As Nullable(Of Long) = Nothing, Optional sampleName As Nullable(Of SampleSchemaName) = Nothing, Optional elasticPoolId As ResourceIdentifier = Nothing, Optional sourceDatabaseId As ResourceIdentifier = Nothing, Optional status As Nullable(Of SqlDatabaseStatus) = Nothing, Optional databaseId As Nullable(Of Guid) = Nothing, Optional createdOn As Nullable(Of DateTimeOffset) = Nothing, Optional currentServiceObjectiveName As String = Nothing, Optional requestedServiceObjectiveName As String = Nothing, Optional defaultSecondaryLocation As Nullable(Of AzureLocation) = Nothing, Optional failoverGroupId As ResourceIdentifier = Nothing, Optional restorePointInTime As Nullable(Of DateTimeOffset) = Nothing, Optional sourceDatabaseDeletedOn As Nullable(Of DateTimeOffset) = Nothing, Optional recoveryServicesRecoveryPointId As ResourceIdentifier = Nothing, Optional longTermRetentionBackupResourceId As ResourceIdentifier = Nothing, Optional recoverableDatabaseId As ResourceIdentifier = Nothing, Optional restorableDroppedDatabaseId As ResourceIdentifier = Nothing, Optional catalogCollation As Nullable(Of CatalogCollationType) = Nothing, Optional isZoneRedundant As Nullable(Of Boolean) = Nothing, Optional licenseType As Nullable(Of DatabaseLicenseType) = Nothing, Optional maxLogSizeBytes As Nullable(Of Long) = Nothing, Optional earliestRestoreOn As Nullable(Of DateTimeOffset) = Nothing, Optional readScale As Nullable(Of DatabaseReadScale) = Nothing, Optional highAvailabilityReplicaCount As Nullable(Of Integer) = Nothing, Optional secondaryType As Nullable(Of SecondaryType) = Nothing, Optional currentSku As SqlSku = Nothing, Optional autoPauseDelay As Nullable(Of Integer) = Nothing, Optional currentBackupStorageRedundancy As Nullable(Of SqlBackupStorageRedundancy) = Nothing, Optional requestedBackupStorageRedundancy As Nullable(Of SqlBackupStorageRedundancy) = Nothing, Optional minCapacity As Nullable(Of Double) = Nothing, Optional pausedOn As Nullable(Of DateTimeOffset) = Nothing, Optional resumedOn As Nullable(Of DateTimeOffset) = Nothing, Optional maintenanceConfigurationId As ResourceIdentifier = Nothing, Optional isLedgerOn As Nullable(Of Boolean) = Nothing, Optional isInfraEncryptionEnabled As Nullable(Of Boolean) = Nothing, Optional federatedClientId As Nullable(Of Guid) = Nothing, Optional keys As IDictionary(Of String, SqlDatabaseKey) = Nothing, Optional encryptionProtector As String = Nothing, Optional preferredEnclaveType As Nullable(Of SqlAlwaysEncryptedEnclaveType) = Nothing, Optional useFreeLimit As Nullable(Of Boolean) = Nothing, Optional freeLimitExhaustionBehavior As Nullable(Of FreeLimitExhaustionBehavior) = Nothing, Optional sourceResourceId As ResourceIdentifier = Nothing, Optional manualCutover As Nullable(Of Boolean) = Nothing, Optional performCutover As Nullable(Of Boolean) = Nothing, Optional availabilityZone As Nullable(Of SqlAvailabilityZoneType) = Nothing, Optional encryptionProtectorAutoRotation As Nullable(Of Boolean) = Nothing) As SqlDatabaseData

参数

name
String

名称。

resourceType
ResourceType

resourceType。

systemData
SystemData

systemData。

tags
IDictionary<String,String>

标记。

location
AzureLocation

位置。

sku
SqlSku

数据库 SKU。

SKU 列表可能因区域和支持产品/服务而异。 若要确定 SKU (包括 AZURE 区域中订阅可用的 SKU 名称、层/版本、系列和容量) ,请使用 Capabilities_ListByLocation REST API 或以下命令之一:

az sql db list-editions -l &lt;location&gt; -o table
Get-AzSqlServerServiceObjective -Location &lt;location&gt;
kind
String

数据库类型。 这是用于Azure 门户体验的元数据。

managedBy
String

管理数据库的资源。

identity
DatabaseIdentity

数据库的 Azure Active Directory 标识。

createMode
Nullable<SqlDatabaseCreateMode>

指定数据库创建模式。

默认值:常规数据库创建。

复制:将数据库创建为现有数据库的副本。 sourceDatabaseId 必须指定为源数据库的资源 ID。

辅助数据库:将数据库创建为现有数据库的辅助副本 (replica) 。 sourceDatabaseId 必须指定为现有主数据库的资源 ID。

PointInTimeRestore:通过还原现有数据库的时间点备份来创建数据库。 sourceDatabaseId 必须指定为现有数据库的资源 ID,并且必须指定 restorePointInTime。

恢复:通过还原异地复制的备份来创建数据库。 sourceDatabaseId 必须指定为要还原的可恢复数据库资源 ID。

还原:通过还原已删除数据库的备份来创建数据库。 必须指定 sourceDatabaseId。 如果 sourceDatabaseId 是数据库的原始资源 ID,则必须指定 sourceDatabaseDeletionDate。 否则,sourceDatabaseId 必须是可还原的已删除数据库资源 ID,并且 sourceDatabaseDeletionDate 将被忽略。 还可以指定 restorePointInTime 从较早的时间点还原。

RestoreLongTermRetentionBackup:通过从长期保留保管库还原来创建数据库。 recoveryServicesRecoveryPointResourceId 必须指定为恢复点资源 ID。

DataWarehouse 版本不支持 Copy、Secondary 和 RestoreLongTermRetentionBackup。

collation
String

数据库的排序规则。

maxSizeBytes
Nullable<Int64>

以字节表示的数据库的最大大小。

sampleName
Nullable<SampleSchemaName>

创建此数据库时要应用的示例架构的名称。

elasticPoolId
ResourceIdentifier

包含此数据库的弹性池的资源标识符。

sourceDatabaseId
ResourceIdentifier

与此数据库的创建操作关联的源数据库的资源标识符。

status
Nullable<SqlDatabaseStatus>

数据库的状态。

databaseId
Nullable<Guid>

数据库的 ID。

createdOn
Nullable<DateTimeOffset>

数据库的创建日期 (ISO8601 格式) 。

currentServiceObjectiveName
String

数据库的当前服务级别目标名称。

requestedServiceObjectiveName
String

数据库请求的服务级别目标名称。

defaultSecondaryLocation
Nullable<AzureLocation>

此数据库的默认次要区域。

failoverGroupId
ResourceIdentifier

此数据库所属的故障转移组资源标识符。

restorePointInTime
Nullable<DateTimeOffset>

指定要还原以创建新数据库的源数据库的时间点 (ISO8601 格式) 。

sourceDatabaseDeletedOn
Nullable<DateTimeOffset>

指定数据库被删除的时间。

recoveryServicesRecoveryPointId
ResourceIdentifier

与此数据库的创建操作关联的恢复点的资源标识符。

longTermRetentionBackupResourceId
ResourceIdentifier

与此数据库的创建操作关联的长期保留备份的资源标识符。

recoverableDatabaseId
ResourceIdentifier

与此数据库的创建操作关联的可恢复数据库的资源标识符。

restorableDroppedDatabaseId
ResourceIdentifier

与此数据库的创建操作关联的可还原删除数据库的资源标识符。

catalogCollation
Nullable<CatalogCollationType>

元数据目录的排序规则。

isZoneRedundant
Nullable<Boolean>

此数据库是否为区域冗余,这意味着此数据库的副本将分布在多个可用性区域。

licenseType
Nullable<DatabaseLicenseType>

要为此数据库申请的许可证类型。 LicenseIncluded如果需要许可证,或者BasePrice如果你有许可证并且有资格获得Azure 混合权益。

maxLogSizeBytes
Nullable<Int64>

此数据库的最大日志大小。

earliestRestoreOn
Nullable<DateTimeOffset>

这会记录可用于此数据库的最早还原日期和时间, (ISO8601 格式) 。

readScale
Nullable<DatabaseReadScale>

只读路由的状态。 如果启用,连接字符串中应用程序意向设置为只读的连接可能会路由到同一区域中的只读辅助副本 (replica) 。 不适用于弹性池中的超大规模数据库。

highAvailabilityReplicaCount
Nullable<Int32>

与数据库关联的用于提供高可用性的辅助副本数。 不适用于弹性池中的超大规模数据库。

secondaryType
Nullable<SecondaryType>

数据库的辅助类型(如果它是辅助数据库)。 有效值为 Geo、Named 和 Standby。

currentSku
SqlSku

SKU 的名称和层。

autoPauseDelay
Nullable<Int32>

数据库自动暂停的时间(分钟)。 值为 -1 表示禁用自动暂停。

currentBackupStorageRedundancy
Nullable<SqlBackupStorageRedundancy>

用于存储此数据库的备份的存储帐户类型。

requestedBackupStorageRedundancy
Nullable<SqlBackupStorageRedundancy>

用于存储此数据库的备份的存储帐户类型。

minCapacity
Nullable<Double>

数据库始终分配的最小容量(如果未暂停)。

pausedOn
Nullable<DateTimeOffset>

用户配置或操作暂停数据库的日期 (ISO8601 格式) 。 如果数据库已准备就绪,则为 Null。

resumedOn
Nullable<DateTimeOffset>

用户操作或数据库登录恢复数据库的日期 (ISO8601 格式) 。 如果数据库已暂停,则为 Null。

maintenanceConfigurationId
ResourceIdentifier

分配给数据库的维护配置 ID。 此配置定义将发生维护更新的时间段。

isLedgerOn
Nullable<Boolean>

此数据库是否为账本数据库,这意味着数据库中的所有表都是账本表。 注意:创建数据库后,无法更改此属性的值。

isInfraEncryptionEnabled
Nullable<Boolean>

为此数据库启用了基础结构加密。

federatedClientId
Nullable<Guid>

用于跨租户每个数据库 CMK 方案的客户端 ID。

keys
IDictionary<String,SqlDatabaseKey>

要使用的用户分配标识的资源 ID。

encryptionProtector
String

数据库的 Azure 密钥保管库 URI(如果配置了每个数据库客户管理的密钥)。

preferredEnclaveType
Nullable<SqlAlwaysEncryptedEnclaveType>

对数据库请求的 enclave 类型,即默认或 VBS enclave。

useFreeLimit
Nullable<Boolean>

数据库是否使用免费每月限制。 在订阅中的一个数据库上允许。

freeLimitExhaustionBehavior
Nullable<FreeLimitExhaustionBehavior>

指定免费数据库的每月可用限制用尽时的行为。

AutoPause:当该月剩余时间的可用限制用尽时,数据库将自动暂停。

BillForUsage:在用尽免费限制后,数据库将继续联机,任何超额都将计费。

sourceResourceId
ResourceIdentifier

与此数据库的创建操作关联的源的资源标识符。

此属性仅支持 DataWarehouse 版本,并允许跨订阅还原。

指定 sourceResourceId 时,不得指定 sourceDatabaseId、recoverableDatabaseId、restoreableDroppedDatabaseId 和 sourceDatabaseDeletionDate,并且 CreateMode 必须为 PointInTimeRestore、Restore 或 Recover。

当 createMode 为 PointInTimeRestore 时,sourceResourceId 必须是现有数据库或现有 sql 池的资源 ID,并且必须指定 restorePointInTime。

当 createMode 为 Restore 时,sourceResourceId 必须是可还原的已删除数据库或可还原的已删除 sql 池的资源 ID。

当 createMode 为“恢复”时,sourceResourceId 必须是可恢复数据库或可恢复 sql 池的资源 ID。

当源订阅属于与目标订阅不同的租户时,“x-ms-authorization-auxiliary”标头必须包含源租户的身份验证令牌。 有关“x-ms-authorization-auxiliary”标头的更多详细信息,请参阅 https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant

manualCutover
Nullable<Boolean>

是否需要在“将数据库更新到超大规模”层的操作期间完成客户控制的手动直接转换。

此属性仅适用于将数据库从 业务关键/常规用途/高级/标准层缩放到超大规模层时。

指定 manualCutover 时,缩放操作将等待用户输入触发到超大规模数据库的直接转换。

若要触发直接转换,请在缩放操作处于等待状态时提供“performCutover”参数。

performCutover
Nullable<Boolean>

在缩放操作正在进行时,在等待状态期间触发客户控制的手动直接转换。

此属性参数仅适用于随“manualCutover”参数一起启动的缩放操作。

仅当数据库从业务关键/常规用途/高级/标准层扩展到超大规模层时,此属性才适用。

指定 performCutover 时,缩放操作将触发直接转换并执行对超大规模数据库的角色更改。

availabilityZone
Nullable<SqlAvailabilityZoneType>

指定数据库固定到的可用性区域。

encryptionProtectorAutoRotation
Nullable<Boolean>

用于启用或禁用数据库加密保护程序 AKV 密钥的自动轮换的标志。

返回

用于模拟的新 SqlDatabaseData 实例。

适用于