Bicep 資源定義
憑證資源類型可以使用目標作業來部署:
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
若要建立 Microsoft.Web/certificates 資源,請將下列 Bicep 新增至範本。
resource symbolicname 'Microsoft.Web/certificates@2023-01-01' = {
kind: 'string'
location: 'string'
name: 'string'
properties: {
canonicalName: 'string'
domainValidationMethod: 'string'
hostNames: [
'string'
]
keyVaultId: 'string'
keyVaultSecretName: 'string'
password: 'string'
pfxBlob: any(...)
serverFarmId: 'string'
}
tags: {
{customized property}: 'string'
}
}
屬性值
Microsoft.Web/證書
| 名稱 |
說明 |
價值 |
| 類 |
資源種類。 |
字串 |
| 位置 |
資源位置。 |
字串 (必要) |
| 名稱 |
資源名稱 |
字串 (必要) |
| 屬性 |
憑證資源特定屬性 |
CertificateProperties |
| 標記 |
資源標籤 |
標記名稱和值的字典。 請參閱範本中的 標籤 |
憑證屬性
| 名稱 |
說明 |
價值 |
| 規範名稱 |
要透過免費憑證發行之憑證的 CNAME |
字串 |
| domainValidationMethod |
免費憑證的網域驗證方法 |
字串 |
| 主機名 |
憑證適用的主機名。 |
字串[] |
| 金鑰庫ID |
金鑰保存庫 Csm 資源標識符。 |
字串 |
| keyVaultSecretName 金鑰名稱 |
金鑰保存庫 秘密名稱。 |
字串 |
| 密碼 |
憑證密碼。 |
字串 |
| pfxBlob |
Pfx Blob。 |
任何 |
| serverFarmId 伺服器場 ID |
相關聯 App Service 方案的資源標識符,格式為:“/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}”。 |
字串 |
ARM 樣本資源定義
憑證資源類型可以使用目標作業來部署:
使用範例
Azure 快速入門範本
下列 Azure 快速入門範本 部署此資源類型。
若要建立 Microsoft.Web/certificates 資源,請將下列 JSON 新增至範本。
{
"type": "Microsoft.Web/certificates",
"apiVersion": "2023-01-01",
"name": "string",
"kind": "string",
"location": "string",
"properties": {
"canonicalName": "string",
"domainValidationMethod": "string",
"hostNames": [ "string" ],
"keyVaultId": "string",
"keyVaultSecretName": "string",
"password": "string",
"pfxBlob": {},
"serverFarmId": "string"
},
"tags": {
"{customized property}": "string"
}
}
屬性值
Microsoft.Web/證書
| 名稱 |
說明 |
價值 |
| apiVersion |
API 版本 |
'2023-01-01' |
| 類 |
資源種類。 |
字串 |
| 位置 |
資源位置。 |
字串 (必要) |
| 名稱 |
資源名稱 |
字串 (必要) |
| 屬性 |
憑證資源特定屬性 |
CertificateProperties |
| 標記 |
資源標籤 |
標記名稱和值的字典。 請參閱範本中的 標籤 |
| 型別 |
資源類型 |
“Microsoft.Web/證書” |
憑證屬性
| 名稱 |
說明 |
價值 |
| 規範名稱 |
要透過免費憑證發行之憑證的 CNAME |
字串 |
| domainValidationMethod |
免費憑證的網域驗證方法 |
字串 |
| 主機名 |
憑證適用的主機名。 |
字串[] |
| 金鑰庫ID |
金鑰保存庫 Csm 資源標識符。 |
字串 |
| keyVaultSecretName 金鑰名稱 |
金鑰保存庫 秘密名稱。 |
字串 |
| 密碼 |
憑證密碼。 |
字串 |
| pfxBlob |
Pfx Blob。 |
任何 |
| serverFarmId 伺服器場 ID |
相關聯 App Service 方案的資源標識符,格式為:“/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}”。 |
字串 |
憑證資源類型可以使用目標作業來部署:
-
資源團體 關於每個 API 版本變更屬性的清單,請參見 變更日誌。
使用範例
部署 App Service 憑證的基本範例。
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 = "westeurope"
}
variable "certificate_password" {
type = string
description = "The password for the PFX certificate"
sensitive = true
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "certificate" {
type = "Microsoft.Web/certificates@2021-02-01"
name = var.resource_name
parent_id = azapi_resource.resourceGroup.id
location = var.location
body = {
properties = {
pfxBlob = filebase64("testdata/app_service_certificate.pfx")
password = var.certificate_password
}
}
}
若要建立 Microsoft.Web/certificates 資源,請將下列 Terraform 新增至範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Web/certificates@2023-01-01"
name = "string"
parent_id = "string"
location = "string"
tags = {
{customized property} = "string"
}
body = {
kind = "string"
properties = {
canonicalName = "string"
domainValidationMethod = "string"
hostNames = [
"string"
]
keyVaultId = "string"
keyVaultSecretName = "string"
password = "string"
pfxBlob = ?
serverFarmId = "string"
}
}
}
屬性值
Microsoft.Web/證書
| 名稱 |
說明 |
價值 |
| 類 |
資源種類。 |
字串 |
| 位置 |
資源位置。 |
字串 (必要) |
| 名稱 |
資源名稱 |
字串 (必要) |
| 屬性 |
憑證資源特定屬性 |
CertificateProperties |
| 標記 |
資源標籤 |
標記名稱和值的字典。 |
| 型別 |
資源類型 |
“Microsoft.Web/certificates@2023-01-01” |
憑證屬性
| 名稱 |
說明 |
價值 |
| 規範名稱 |
要透過免費憑證發行之憑證的 CNAME |
字串 |
| domainValidationMethod |
免費憑證的網域驗證方法 |
字串 |
| 主機名 |
憑證適用的主機名。 |
字串[] |
| 金鑰庫ID |
金鑰保存庫 Csm 資源標識符。 |
字串 |
| keyVaultSecretName 金鑰名稱 |
金鑰保存庫 秘密名稱。 |
字串 |
| 密碼 |
憑證密碼。 |
字串 |
| pfxBlob |
Pfx Blob。 |
任何 |
| serverFarmId 伺服器場 ID |
相關聯 App Service 方案的資源標識符,格式為:“/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}”。 |
字串 |