Microsoft。SQL 伺服器/資料庫/透明資料加密

Bicep 資源定義

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

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

資源格式

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

resource symbolicname 'Microsoft.Sql/servers/databases/transparentDataEncryption@2025-02-01-preview' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    scanState: 'string'
    state: 'string'
  }
}

屬性值

Microsoft。Sql/servers/databases/transparentDataEncryption

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

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

TransparentDataEncryptionProperties

Name Description Value
scanState 指定透明數據加密的加密掃描狀態。 “流產”
'Completed'
'None'
“簡歷”
'Running'
“暫停”
狀態 指定透明數據加密的狀態。 'Disabled'
'Enabled' (必要)

使用範例

Bicep Samples

部署 SQL Server 資料庫的基本範例:透明資料加密。

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

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

resource database 'Microsoft.Sql/servers/databases@2021-02-01-preview' = {
  name: resourceName
  location: location
  parent: server
  properties: {
    autoPauseDelay: 0
    createMode: 'Default'
    elasticPoolId: ''
    highAvailabilityReplicaCount: 0
    isLedgerOn: false
    licenseType: 'LicenseIncluded'
    maintenanceConfigurationId: resourceId('Microsoft.Maintenance/publicMaintenanceConfigurations', 'SQL_Default')
    minCapacity: 0
    readScale: 'Disabled'
    requestedBackupStorageRedundancy: 'Geo'
    zoneRedundant: false
  }
}

resource transparentDataEncryption 'Microsoft.Sql/servers/databases/transparentDataEncryption@2014-04-01' = {
  name: 'current'
  parent: database
  properties: {
    status: 'Enabled'
  }
}

Azure Quickstart Samples

以下的 Azure 快速啟動範本包含部署此資源類型的Bicep範例。

Bicep檔案 Description
專用 SQL 池,具備透明加密 建立 SQL Server 及專用 SQL 池(前稱 SQL DW),並具備 透明資料加密 功能。

ARM 樣本資源定義

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

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

資源格式

創造一個 Microsoft。Sql/servers/databases/transparentDataEncryption 資源,將以下 JSON 加入你的範本。

{
  "type": "Microsoft.Sql/servers/databases/transparentDataEncryption",
  "apiVersion": "2025-02-01-preview",
  "name": "string",
  "properties": {
    "scanState": "string",
    "state": "string"
  }
}

屬性值

Microsoft。Sql/servers/databases/transparentDataEncryption

Name Description Value
apiVersion API 版本 “2025-02-01-預覽”
name 資源名稱 'current' (必要)
properties 資源屬性。 TransparentDataEncryptionProperties
型別 資源類型 「Microsoft。Sql/servers/databases/transparentDataEncryption'

TransparentDataEncryptionProperties

Name Description Value
scanState 指定透明數據加密的加密掃描狀態。 “流產”
'Completed'
'None'
“簡歷”
'Running'
“暫停”
狀態 指定透明數據加密的狀態。 'Disabled'
'Enabled' (必要)

使用範例

Azure Quickstart templates

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

Template Description
專用 SQL 池,具備透明加密

部署至Azure
建立 SQL Server 及專用 SQL 池(前稱 SQL DW),並具備 透明資料加密 功能。

Terraform (AzAPI 提供者) 資源定義

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

  • 資源群組

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

資源格式

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

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Sql/servers/databases/transparentDataEncryption@2025-02-01-preview"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      scanState = "string"
      state = "string"
    }
  }
}

屬性值

Microsoft。Sql/servers/databases/transparentDataEncryption

Name Description Value
name 資源名稱 'current' (必要)
parent_id 此資源為父系之資源的標識碼。 類型資源的標識碼:伺服器/資料庫
properties 資源屬性。 TransparentDataEncryptionProperties
型別 資源類型 「Microsoft。Sql/servers/databases/transparentDataEncryption@2025-02-01-preview”

TransparentDataEncryptionProperties

Name Description Value
scanState 指定透明數據加密的加密掃描狀態。 “流產”
'Completed'
'None'
“簡歷”
'Running'
“暫停”
狀態 指定透明數據加密的狀態。 'Disabled'
'Enabled' (必要)

使用範例

Terraform 範例

部署 SQL Server 資料庫的基本範例:透明資料加密。

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

provider "azurerm" {
  features {
  }
}

provider "azapi" {
  skip_provider_registration = false
}

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

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

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

data "azurerm_client_config" "current" {
}

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@2021-02-01-preview"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      administratorLogin            = "mradministrator"
      administratorLoginPassword    = var.administrator_login_password
      minimalTlsVersion             = "1.2"
      publicNetworkAccess           = "Enabled"
      restrictOutboundNetworkAccess = "Disabled"
      version                       = "12.0"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

data "azapi_resource_id" "publicMaintenanceConfiguration" {
  type      = "Microsoft.Maintenance/publicMaintenanceConfigurations@2023-04-01"
  parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}"
  name      = "SQL_Default"
}

resource "azapi_resource" "database" {
  type      = "Microsoft.Sql/servers/databases@2021-02-01-preview"
  parent_id = azapi_resource.server.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      autoPauseDelay                   = 0
      createMode                       = "Default"
      elasticPoolId                    = ""
      highAvailabilityReplicaCount     = 0
      isLedgerOn                       = false
      licenseType                      = "LicenseIncluded"
      maintenanceConfigurationId       = data.azapi_resource_id.publicMaintenanceConfiguration.id
      minCapacity                      = 0
      readScale                        = "Disabled"
      requestedBackupStorageRedundancy = "Geo"
      zoneRedundant                    = false
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_update_resource" "transparentDataEncryption" {
  type      = "Microsoft.Sql/servers/databases/transparentDataEncryption@2014-04-01"
  parent_id = azapi_resource.database.id
  name      = "current"
  body = {
    properties = {
      status = "Enabled"
    }
  }
  response_export_values = ["*"]
}