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

Managed Instance Encryption Protectors - Create Or Update

汇报现有的加密保护程序。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/current?api-version=2021-11-01

URI 参数

名称 必需 类型 说明
encryptionProtectorName
path True

EncryptionProtectorName

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

managedInstanceName
path True

string

托管实例的名称。

resourceGroupName
path True

string

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

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

ManagedInstanceEncryptionProtector

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

202 Accepted

已接受

Other Status Codes

错误响应: ***

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

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

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

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

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

  • 400 SecurityAdalPrincipalCertExpiredError - 操作无法完成,因为 Azure 密钥保管库主体证书已过期。

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

  • 400 SecurityInvalidAzureKeyVaultRecoveryLevel - 提供的密钥保管库 URI 无效。

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

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

  • 400 AzureKeyVaultKeyDisabled - 由于禁用了 Azure 密钥保管库密钥,无法在服务器上完成该操作。

  • 400 AzureKeyVaultInvalidExpirationDate - 无法完成操作,因为 Azure 密钥保管库密钥过期日期无效。

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

  • 400 SecurityAzureKeyVaultUrlNullOrEmpty - 无法完成操作,因为 Azure 密钥保管库 URI 为 null 或空。

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

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

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

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

  • 400 AzureKeyVaultInvalidUri - 来自 Azure 密钥保管库的无效响应。 请使用有效的 Azure 密钥保管库 URI。

  • 400 AzureKeyVaultMissingPermissions - 服务器缺少对 Azure 密钥保管库所需的权限。

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

  • 400 AkvEndpointNotReachableFromNode - 服务器“”{0}上的 SQL 无法访问 AKV 终结点“”。{1}

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

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

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

  • 400 AzureKeyVaultMalformedVaultUri - 提供的密钥保管库 URI 无效。

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

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

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

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

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

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

  • 404 OperationIdNotFound - ID 为 的操作不存在。

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

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

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

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

  • 409 AzureKeyVaultKeyNameNotFound - 操作无法完成,因为 Azure 密钥保管库密钥名称不存在。

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

  • 409 OperationCancelled - 用户已取消该操作。

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

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

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

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

  • 503 AzureKeyVaultConnectionFailed - 无法完成该操作在服务器上,因为尝试连接到 Azure 密钥保管库失败

  • 503 AzureKeyVaultGenericConnectionError - 无法完成该操作,因为尝试检索密钥保管库信息 时遇到错误。

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

示例

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

Update the encryption protector to key vault

Sample Request

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

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

Sample Response

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

Update the encryption protector to service managed

Sample Request

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

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

Sample Response

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

定义

名称 说明
EncryptionProtectorName

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

ManagedInstanceEncryptionProtector

托管实例加密保护程序。

ServerKeyType

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

EncryptionProtectorName

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

名称 类型 说明
current

string

ManagedInstanceEncryptionProtector

托管实例加密保护程序。

名称 类型 说明
id

string

资源 ID。

kind

string

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

name

string

资源名称。

properties.autoRotationEnabled

boolean

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

properties.serverKeyName

string

托管实例密钥的名称。

properties.serverKeyType

ServerKeyType

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

properties.thumbprint

string

服务器密钥的指纹。

properties.uri

string

服务器密钥的 URI。

type

string

资源类型。

ServerKeyType

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

名称 类型 说明
AzureKeyVault

string

ServiceManaged

string