Microsoft。SQL 伺服器/加密保護者

Bicep 資源定義

伺服器/encryptionProtector 資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。

使用範例

Bicep 範例

為 MSSQL Server 部署透明資料加密組態的基本範例。

@secure()
@description('The administrator login password for the SQL server')
param administratorLoginPassword string
param resourceName string = 'acctest0001'
param location string = 'westus'

resource server 'Microsoft.Sql/servers@2023-08-01-preview' = {
  name: resourceName
  location: location
  properties: {
    administratorLogin: 'mradministrator'
    administratorLoginPassword: administratorLoginPassword
    minimalTlsVersion: '1.2'
    publicNetworkAccess: 'Enabled'
    restrictOutboundNetworkAccess: 'Disabled'
    version: '12.0'
  }
}

resource encryptionProtector 'Microsoft.Sql/servers/encryptionProtector@2023-08-01-preview' = {
  name: 'current'
  parent: server
  properties: {
    autoRotationEnabled: false
    serverKeyName: ''
    serverKeyType: 'ServiceManaged'
  }
}

資源格式

創造一個 Microsoft。Sql/servers/encryptionProtector 資源,請將以下 Bicep 加入你的範本。

resource symbolicname 'Microsoft.Sql/servers/encryptionProtector@2026-08-01-preview' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    autoRotationEnabled: bool
    serverKeyName: 'string'
    serverKeyType: 'string'
  }
}

屬性值

Microsoft。SQL/伺服器/加密保護器

Name Description Value
name 資源名稱 'current' (必要)
父代 在 Bicep 中,你可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。

如需詳細資訊,請參閱 父資源外部的子資源。
類型的資源符號名稱:伺服器
properties 資源屬性。 EncryptionProtectorProperties

EncryptionProtectorProperties

Name Description Value
autoRotationEnabled 金鑰自動輪替選擇加入旗標。 True 或 false。 bool
serverKeyName 伺服器金鑰的名稱。 字串
serverKeyType 加密保護裝置類型,例如 'ServiceManaged'、'AzureKeyVault'。 'AzureKeyVault'
'ServiceManaged' (必要)

ARM 樣本資源定義

伺服器/encryptionProtector 資源類型可以使用目標作業來部署:

使用範例

Azure Quickstart templates

以下的 Azure 快速起始範本部署此資源類型。

Template Description
建立一個Azure SQL Server,並附上資料加密保護器

部署至Azure
這個範本會建立一個 Azure SQL 伺服器,並利用儲存在指定 金鑰保存庫 中的指定金鑰啟動資料加密保護器

資源格式

創造一個 Microsoft。Sql/servers/encryptionProtector 資源,請在你的範本中加入以下 JSON。

{
  "type": "Microsoft.Sql/servers/encryptionProtector",
  "apiVersion": "2026-08-01-preview",
  "name": "string",
  "properties": {
    "autoRotationEnabled": "bool",
    "serverKeyName": "string",
    "serverKeyType": "string"
  }
}

屬性值

Microsoft。SQL/伺服器/加密保護器

Name Description Value
apiVersion API 版本 『2026-08-01-預覽』
name 資源名稱 'current' (必要)
properties 資源屬性。 EncryptionProtectorProperties
型別 資源類型 「Microsoft。Sql/servers/encryptionProtector'

EncryptionProtectorProperties

Name Description Value
autoRotationEnabled 金鑰自動輪替選擇加入旗標。 True 或 false。 bool
serverKeyName 伺服器金鑰的名稱。 字串
serverKeyType 加密保護裝置類型,例如 'ServiceManaged'、'AzureKeyVault'。 'AzureKeyVault'
'ServiceManaged' (必要)

Terraform (AzAPI 提供者) 資源定義

伺服器/encryptionProtector 資源類型可以使用目標作業來部署:

  • 資源團體 關於每個 API 版本變更屬性的清單,請參見 變更日誌。

使用範例

Terraform 範例

為 MSSQL Server 部署透明資料加密組態的基本範例。

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westus"
}

variable "administrator_login_password" {
  type        = string
  sensitive   = true
  description = "The administrator login password for the SQL server"
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "server" {
  type      = "Microsoft.Sql/servers@2023-08-01-preview"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  identity {
    type         = "SystemAssigned"
    identity_ids = []
  }
  body = {
    properties = {
      administratorLogin            = "mradministrator"
      administratorLoginPassword    = var.administrator_login_password
      minimalTlsVersion             = "1.2"
      publicNetworkAccess           = "Enabled"
      restrictOutboundNetworkAccess = "Disabled"
      version                       = "12.0"
    }
  }
}

resource "azapi_resource" "encryptionProtector" {
  type      = "Microsoft.Sql/servers/encryptionProtector@2023-08-01-preview"
  parent_id = azapi_resource.server.id
  name      = "current"
  body = {
    properties = {
      autoRotationEnabled = false
      serverKeyName       = ""
      serverKeyType       = "ServiceManaged"
    }
  }
}

資源格式

創造一個 Microsoft。Sql/servers/encryptionProtector 資源,請將以下 Terraform 加入你的範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Sql/servers/encryptionProtector@2026-08-01-preview"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      autoRotationEnabled = bool
      serverKeyName = "string"
      serverKeyType = "string"
    }
  }
}

屬性值

Microsoft。SQL/伺服器/加密保護器

Name Description Value
name 資源名稱 'current' (必要)
parent_id 此資源為父系之資源的標識碼。 類型資源的標識碼:伺服器
properties 資源屬性。 EncryptionProtectorProperties
型別 資源類型 「Microsoft。SQL/servers/encryptionProtector@2026-08-01-preview」

EncryptionProtectorProperties

Name Description Value
autoRotationEnabled 金鑰自動輪替選擇加入旗標。 True 或 false。 bool
serverKeyName 伺服器金鑰的名稱。 字串
serverKeyType 加密保護裝置類型,例如 'ServiceManaged'、'AzureKeyVault'。 'AzureKeyVault'
'ServiceManaged' (必要)