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

Encryption Protectors - Create Or Update

更新现有的加密保护程序。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/current?api-version=2023-08-01

URI 参数

名称 必需 类型 说明
encryptionProtectorName
path True

EncryptionProtectorName

要更新的加密保护程序的名称。

resourceGroupName
path True

string

包含资源的资源组的名称。 可以从 Azure 资源管理器 API 或门户获取此值。

serverName
path True

string

服务器的名称。

subscriptionId
path True

string

标识 Azure 订阅的订阅 ID。

api-version
query True

string

要用于请求的 API 版本。

请求正文

名称 必需 类型 说明
properties.serverKeyType True

ServerKeyType

加密保护程序类型,例如“ServiceManaged”、“AzureKeyVault”。

properties.autoRotationEnabled

boolean

密钥自动轮换选择加入标志。 true 或 false。

properties.serverKeyName

string

服务器密钥的名称。

响应

名称 类型 说明
200 OK

EncryptionProtector

已成功更新加密保护程序。

202 Accepted

接受

标头

Location: string

Other Status Codes

ErrorResponse

错误响应: ***

  • 400 ManagedInstanceStoppingOrStopped - 实例处于停止/停止状态时提交的冲突作

  • 400 ManagedInstanceStarting - 实例处于启动状态时提交的冲突作

  • 400 InvalidKeyName - 为服务器密钥名称提供了无效值。

  • 400 InvalidKeyType - 不支持创建服务器密钥类型。

  • 400 InvalidUpsertKeyType - 服务管理的 TDE 密钥由服务管理。 服务管理的 TDE 密钥不支持用户创建或更新。

  • 400 InvalidKeyUpsertRequest - 创建服务器密钥请求不存在或没有属性对象。

  • 400 InvalidEncryptionProtectorName - 不支持加密保护程序密钥名称。

  • 400 SecurityAdalPrincipalCertExpiredError - 无法完成该作,因为 Azure Key Vault 主体证书已过期。

  • 400 AkvHostNotResolvingFromNode - AKV 主机“{0}”无法从 SQL 解析,服务器“{1}”。

  • 400 SecurityInvalidAzureKeyVaultRecoveryLevel - 提供的 Key Vault URI 无效。

  • 400 MissingKeyVaultUriForRestore - 成功还原服务器“{0}”下的数据库“{1}”所需的 Azure Key Vault 密钥 URI“{2}”。

  • 400 AzureKeyVaultKeyUsedOnGeoPrimary - 无法完成该作,因为 Azure Key Vault 密钥名称 {0} 当前在异地主数据库上设置为加密保护程序。

  • 400 KeyMaterialNotFoundOnRemoteServer - 远程服务器无权访问用作 TDE 保护程序的密钥材料。

  • 400 PerDatabaseCMKAKVKeyMaterialMissingOnGeoSecondary - 异地复制中的所有数据库必须包含与源数据库的加密保护程序相同的密钥材料。 请将具有相同密钥材料的密钥“{0}”添加到目标数据库“{1}”。

  • 400 AzureKeyVaultRsaKeyNotSupported - 提供的密钥保管库使用不支持的 RSA 密钥大小或密钥类型。 支持的 RSA 密钥大小为 2048 或 3072,密钥类型为 RSA 或 RSA-HSM。

  • 400 PerDatabaseCMKAKVKeyUriMissingOnGeoSecondary - 启用数据库级别 TDE 保护程序的自动轮换时,源数据库和目标数据库必须连接到同一密钥保管库。 请将密钥“{0}”(从连接到源数据库的同一密钥保管库)添加到目标数据库“{1}”。

  • 400 PerDatabaseCMKCopyOrReplicationAttemptedWithoutCurrentKeysWithDatabaseName - 尝试复制使用数据库级别加密保护程序配置的数据库时,主数据库正在使用的当前密钥必须传递给辅助数据库“{0}”

  • 400 ManagedInstanceNoConditionToMakeDatabaseAccessible -作无法完成,因为没有足够的权限启动托管实例上的可访问工作流 {0}。

  • 400 UmiMissingAkvPermissions - 用户提供的 PrimaryUserAssignedIdentityId 无权访问提供的 KeyId

  • 400 SameKeyUriNotFoundOnRemoteServer - 辅助服务器没有与启用了密钥自动轮换的主服务器的加密保护程序相同的密钥保管库中的密钥材料。

  • 400 SameKeyMaterialNotFoundOnRemoteServer - 辅助服务器没有主服务器的加密保护程序的密钥材料。

  • 400 SecurityAzureKeyVaultGeoChainError - 使用 Azure Key Vault(BYOK)启用透明数据加密时不支持创建辅助数据库(称为链接的进程)。

  • 400 PerDatabaseCMKDWNotSupported - Datawarehouse 版本不支持预览版的数据库级 CMK。

  • 400 BlockSystemAssignedIdentityForCrossTenantCMK - 仅当服务器配置有用户分配的托管标识时,才能配置跨租户 CMK。 请参阅 https://aka.ms/sqltdebyokumi 来配置用户分配的托管标识。

  • 400 PerDatabaseCMKCopyOrReplicationAttemptedWithoutCurrentKeys - 尝试复制使用数据库级别加密保护程序配置的数据库时,主数据库正在使用的当前密钥必须传递给辅助数据库。

  • 400 CannotDropDatabaseAKVError - 无法安全地删除服务器 {0} 上的数据库 {1},因为它使用客户管理的密钥进行加密,该密钥在删除之前无法再进行上次备份。 请在服务器上还原 Azure Key Vault 访问,并重新验证密钥以使此数据库可访问,然后继续删除。 有关详细信息,请参阅 https://aka.ms/tdecmkrestorability

  • 400 CreateDatabaseAttemptedWithRotationInProgress - 由于服务器上的透明数据加密(TDE)密钥轮换,目前无法执行创建数据库作。 请稍后再次尝试该作。

  • 400 AzureKeyVaultKeyDisabled - 无法在服务器上完成该作,因为 Azure Key Vault 密钥已禁用。

  • 400 PerDatabaseCMKRestoreNotSupported - 在预览版中配置数据库级 CMK 时不支持数据库还原。

  • 400 AzureKeyVaultInvalidExpirationDate - 无法完成该作,因为 Azure Key Vault 密钥到期日期无效。

  • 超大规模版本不支持 400 PerDatabaseCMKHSNotSupported - 预览版中的数据库级 CMK。

  • 400 SecurityAzureKeyVaultUrlNullOrEmpty - 无法完成作,因为 Azure Key Vault URI 为 null 或为空。

  • 400 CMKOperationNotAllowed - 当服务器没有 Azure Key Vault 访问时,用户尝试在服务器上执行作。

  • 400 AkvEndpointNotReachableFromNode - AKV 终结点“{0}”无法从 SQL 访问,位于服务器“{1}”。

  • 400 AzureKeyVaultNoServerIdentity - 服务器标识未正确配置。

  • 400 AzureKeyVaultInvalidUri - 来自 Azure Key Vault 的无效响应。 请使用有效的 Azure Key Vault URI。

  • 400 AzureKeyVaultMissingPermissions - 服务器缺少对 Azure Key Vault 所需的权限。

  • 400 AzureKeyVaultKeyNameCurrentlyInUse - 无法完成该作,因为 Azure Key Vault 密钥名称 {0} 当前正在使用中。

  • 400 AzureKeyVaultKeyThumbprintIsDifferent - 无法完成该作,因为 Azure Key Vault 密钥材料不同于当前加密保护程序密钥。

  • 400 SecurityAzureKeyVaultInvalidKeyName - 由于服务器密钥名称无效,无法完成该作。

  • 400 OldGenerationOfAKVKeyBeingUsedError - 不允许将旧版 AKV 密钥用作 TDE 保护程序。 请使用最新版本的 AKV 密钥作为加密保护程序

  • 400 PerDatabaseCMKMissingIdentityOnGeoSecondaryDatabase - 未在目标数据库上设置 Per Database CMK 标识。

  • 400 AdalGenericError - 由于遇到 Azure Active Directory 错误,无法完成该作。

  • 400 AdalServicePrincipalNotFound - 无法完成该作,因为遇到 Azure Active Directory 库服务主体找不到错误。

  • 400 AzureKeyVaultMalformedVaultUri - 提供的 Key Vault URI 无效。

  • 404 ServerNotInSubscriptionResourceGroup - 指定的服务器在指定的资源组和订阅中不存在。

  • 404 SubscriptionDoesNotHaveServer - 找不到请求的服务器

  • 404 ResourceNotFound - 找不到请求的资源。

  • 404 ServerKeyNotFound - 当前订阅上找不到请求的服务器密钥。

  • 404 OperationIdNotFound - ID作不存在。

  • 409 EncryptionProtectorChangeInProgress - 在保护程序更改正在进行时无法更新数据库加密密钥保护程序

  • 409 ServerKeyNameAlreadyExists - 服务器上已存在服务器密钥。

  • 409 ServerKeyUriAlreadyExists - 服务器上已存在服务器密钥 URI。

  • 409 ServerKeyDoesNotExists - 服务器密钥不存在。

  • 409 AzureKeyVaultKeyNameNotFound - 无法完成该作,因为 Azure Key Vault 密钥名称不存在。

  • 409 AzureKeyVaultKeyInUse - 服务器当前正在使用密钥。

  • 409 CannotCancelOperation - 管理作处于无法取消的状态。

  • 409 OperationCancelled -作已被用户取消。

  • 409 OperationInterrupted - 无法完成资源上的作,因为它被同一资源上的另一个作中断。

  • 429 SubscriptionTooManyCreateUpdateRequests - 请求超出可用资源可以处理的最大请求数。

  • 429 SubscriptionTooManyRequests - 请求超出可用资源可以处理的最大请求数。

  • 500 OperationTimedOut -作超时并自动回滚。 请重试该作。

  • 503 AzureKeyVaultConnectionFailed - 无法在服务器上完成该作,因为尝试连接到 Azure Key Vault 失败

  • 503 AzureKeyVaultGenericConnectionError - 无法完成该作,因为尝试检索 Key Vault 信息时遇到错误。

  • 503 TooManyRequests - 请求超出可用资源可以处理的最大请求数。

示例

Update the encryption protector to key vault
Update the encryption protector to service managed

Update the encryption protector to key vault

示例请求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/encryptionProtector/current?api-version=2023-08-01

{
  "properties": {
    "serverKeyType": "AzureKeyVault",
    "serverKeyName": "someVault_someKey_01234567890123456789012345678901",
    "autoRotationEnabled": false
  }
}

示例响应

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/encryptionProtector/current",
  "name": "current",
  "type": "Microsoft.Sql/servers/encryptionProtector",
  "location": "West US",
  "kind": "azurekeyvault",
  "properties": {
    "serverKeyName": "someVault_someKey_01234567890123456789012345678901",
    "serverKeyType": "AzureKeyVault",
    "autoRotationEnabled": false
  }
}

Update the encryption protector to service managed

示例请求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/encryptionProtector/current?api-version=2023-08-01

{
  "properties": {
    "serverKeyType": "ServiceManaged",
    "serverKeyName": "ServiceManaged"
  }
}

示例响应

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/encryptionProtector/current",
  "name": "current",
  "type": "Microsoft.Sql/servers/encryptionProtector",
  "location": "West US",
  "kind": "servicemanaged",
  "properties": {
    "serverKeyName": "ServiceManaged",
    "serverKeyType": "ServiceManaged"
  }
}

定义

名称 说明
EncryptionProtector

服务器加密保护程序。

EncryptionProtectorName

要更新的加密保护程序的名称。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

ServerKeyType

加密保护程序类型,例如“ServiceManaged”、“AzureKeyVault”。

EncryptionProtector

服务器加密保护程序。

名称 类型 说明
id

string

资源 ID。

kind

string

加密保护程序的类型。 这是用于 Azure 门户体验的元数据。

location

string

资源位置。

name

string

资源名称。

properties.autoRotationEnabled

boolean

密钥自动轮换选择加入标志。 true 或 false。

properties.serverKeyName

string

服务器密钥的名称。

properties.serverKeyType

ServerKeyType

加密保护程序类型,例如“ServiceManaged”、“AzureKeyVault”。

properties.subregion

string

加密保护器的子区域。

properties.thumbprint

string

服务器密钥的指纹。

properties.uri

string

服务器密钥的 URI。

type

string

资源类型。

EncryptionProtectorName

要更新的加密保护程序的名称。

说明
current

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

ServerKeyType

加密保护程序类型,例如“ServiceManaged”、“AzureKeyVault”。

说明
AzureKeyVault
ServiceManaged