- 最新
- 2025-11-01-預覽
- 2025-10-15
- 2025-05-01-預覽版
- 2025-04-15
- 2024-12-01-預覽版
- 2024-11-15
- 2024-09-01-預覽版
- 2024-08-15
- 2024-05-15
- 2024-05-15-預覽版
- 2024-02-15-預覽版
- 2023-11-15
- 2023-11-15-預覽版
- 2023-09-15
- 2023-09-15-預覽版
- 2023-04-15
- 2023-03-15
- 2023-03-15-預覽版
- 2023-03-01-預覽版
- 2022-11-15
- 2022-11-15-預覽版
- 2022-08-15
- 2022-08-15-預覽版
- 2022-05-15
- 2022-05-15-預覽版
- 2022-02-15-預覽版
- 2021-11-15-預覽版
- 2021-10-15
- 2021-10-15-預覽版
- 2021-07-01-預覽版
- 2021-06-15
- 2021-05-15
- 2021-04-15
- 2021-04-01-預覽版
- 2021-03-15
- 2021-03-01-預覽版
- 2021-01-15
- 2020-09-01
- 2020-06-01-預覽版
- 2020-04-01
- 2020-03-01
- 2019-12-12
- 2019-08-01
Bicep 資源定義
databaseAccounts/sqlDatabases/containers/triggers 資源類型可以使用目標作業來部署:
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
資源格式
若要建立 Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/triggers 資源,請將下列 Bicep 新增至範本。
resource symbolicname 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/triggers@2020-09-01' = {
parent: resourceSymbolicName
location: 'string'
name: 'string'
properties: {
options: {
autoscaleSettings: {
maxThroughput: int
}
throughput: int
}
resource: {
body: 'string'
id: 'string'
triggerOperation: 'string'
triggerType: 'string'
}
}
tags: {
{customized property}: 'string'
}
}
屬性值
Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/triggers
| 名字 | 描述 | 價值 |
|---|---|---|
| 位置 | 資源所屬資源群組的位置。 | 字串 |
| 名字 | 資源名稱 | 字串 (必要) |
| 父代 | 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。 如需詳細資訊,請參閱 父資源外部的子資源。 |
類型資源的符號名稱:databaseAccounts/sqlDatabases/containers |
| 性能 | 建立及更新 Azure Cosmos DB 觸發程序的屬性。 | SqlTriggerCreateUpdatePropertiesOrSqlTriggerGetProperties (必要) |
| 標籤 | 資源標籤 | 標記名稱和值的字典。 請參閱範本中的 標籤 |
AutoscaleSettings
| 名字 | 描述 | 價值 |
|---|---|---|
| maxThroughput (最大輸送量) | 代表最大輸送量,資源可以相應增加至 。 | 整數 (int) |
CreateUpdateOptions
| 名字 | 描述 | 價值 |
|---|---|---|
| autoscaleSettings | 指定自動調整設定。 | AutoscaleSettings |
| 輸送量 | 每秒要求單位數。 例如,「輸送量」:10000。 | 整數 (int) |
SqlTriggerCreateUpdatePropertiesOrSqlTriggerGetProperties
| 名字 | 描述 | 價值 |
|---|---|---|
| 選項 | 要套用要求之選項的索引鍵/值組。 這會對應至隨要求傳送的標頭。 | CreateUpdateOptions |
| 資源 | 觸發程式的標準 JSON 格式 | SqlTriggerResourceOrSqlTriggerGetPropertiesResource (必要) |
SqlTriggerResourceOrSqlTriggerGetPropertiesResource
| 名字 | 描述 | 價值 |
|---|---|---|
| 身體 | 觸發程序的主體 | 字串 |
| 識別碼 | Cosmos DB SQL 觸發程式的名稱 | 字串 (必要) |
| triggerOperation | 觸發程式相關聯的作業 | '全部' “創建” '刪除' '替換' “更新” |
| triggerType | 觸發程式的類型 | '發佈' 'Pre' |
標籤
| 名字 | 描述 | 價值 |
|---|
使用範例
Azure 快速入門範例
下列 Azure 快速入門範本 包含用於部署此資源類型的 Bicep 範例。
| Bicep 檔案 | 描述 |
|---|---|
| 建立 Azure Cosmos DB Core (SQL) API 預存程式 | 此範本會建立適用於 Core (SQL) API 的 Azure Cosmos DB 帳戶,以及具有預存程式、觸發程式和使用者定義函式的容器。 |
ARM 樣本資源定義
databaseAccounts/sqlDatabases/containers/triggers 資源類型可以使用目標作業來部署:
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
資源格式
若要建立 Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/triggers 資源,請將下列 JSON 新增至範本。
{
"type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/triggers",
"apiVersion": "2020-09-01",
"name": "string",
"location": "string",
"properties": {
"options": {
"autoscaleSettings": {
"maxThroughput": "int"
},
"throughput": "int"
},
"resource": {
"body": "string",
"id": "string",
"triggerOperation": "string",
"triggerType": "string"
}
},
"tags": {
"{customized property}": "string"
}
}
屬性值
Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/triggers
| 名字 | 描述 | 價值 |
|---|---|---|
| apiVersion | API 版本 | '2020-09-01' |
| 位置 | 資源所屬資源群組的位置。 | 字串 |
| 名字 | 資源名稱 | 字串 (必要) |
| 性能 | 建立及更新 Azure Cosmos DB 觸發程序的屬性。 | SqlTriggerCreateUpdatePropertiesOrSqlTriggerGetProperties (必要) |
| 標籤 | 資源標籤 | 標記名稱和值的字典。 請參閱範本中的 標籤 |
| 型別 | 資源類型 | “Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/triggers” |
AutoscaleSettings
| 名字 | 描述 | 價值 |
|---|---|---|
| maxThroughput (最大輸送量) | 代表最大輸送量,資源可以相應增加至 。 | 整數 (int) |
CreateUpdateOptions
| 名字 | 描述 | 價值 |
|---|---|---|
| autoscaleSettings | 指定自動調整設定。 | AutoscaleSettings |
| 輸送量 | 每秒要求單位數。 例如,「輸送量」:10000。 | 整數 (int) |
SqlTriggerCreateUpdatePropertiesOrSqlTriggerGetProperties
| 名字 | 描述 | 價值 |
|---|---|---|
| 選項 | 要套用要求之選項的索引鍵/值組。 這會對應至隨要求傳送的標頭。 | CreateUpdateOptions |
| 資源 | 觸發程式的標準 JSON 格式 | SqlTriggerResourceOrSqlTriggerGetPropertiesResource (必要) |
SqlTriggerResourceOrSqlTriggerGetPropertiesResource
| 名字 | 描述 | 價值 |
|---|---|---|
| 身體 | 觸發程序的主體 | 字串 |
| 識別碼 | Cosmos DB SQL 觸發程式的名稱 | 字串 (必要) |
| triggerOperation | 觸發程式相關聯的作業 | '全部' “創建” '刪除' '替換' “更新” |
| triggerType | 觸發程式的類型 | '發佈' 'Pre' |
標籤
| 名字 | 描述 | 價值 |
|---|
使用範例
Azure 快速入門範本
下列 Azure 快速入門範本 部署此資源類型。
| 範本 | 描述 |
|---|---|
|
建立 Azure Cosmos DB Core (SQL) API 預存程式 |
此範本會建立適用於 Core (SQL) API 的 Azure Cosmos DB 帳戶,以及具有預存程式、觸發程式和使用者定義函式的容器。 |
Terraform (AzAPI 提供者) 資源定義
databaseAccounts/sqlDatabases/containers/triggers 資源類型可以使用目標作業來部署:
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
資源格式
若要建立 Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/triggers 資源,請將下列 Terraform 新增至範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/triggers@2020-09-01"
name = "string"
parent_id = "string"
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
options = {
autoscaleSettings = {
maxThroughput = int
}
throughput = int
}
resource = {
body = "string"
id = "string"
triggerOperation = "string"
triggerType = "string"
}
}
}
}
屬性值
Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/triggers
| 名字 | 描述 | 價值 |
|---|---|---|
| 位置 | 資源所屬資源群組的位置。 | 字串 |
| 名字 | 資源名稱 | 字串 (必要) |
| 父項識別碼 | 此資源為父系之資源的標識碼。 | 類型資源的標識碼:databaseAccounts/sqlDatabases/containers |
| 性能 | 建立及更新 Azure Cosmos DB 觸發程序的屬性。 | SqlTriggerCreateUpdatePropertiesOrSqlTriggerGetProperties (必要) |
| 標籤 | 資源標籤 | 標記名稱和值的字典。 |
| 型別 | 資源類型 | “Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/triggers@2020-09-01” |
AutoscaleSettings
| 名字 | 描述 | 價值 |
|---|---|---|
| maxThroughput (最大輸送量) | 代表最大輸送量,資源可以相應增加至 。 | 整數 (int) |
CreateUpdateOptions
| 名字 | 描述 | 價值 |
|---|---|---|
| autoscaleSettings | 指定自動調整設定。 | AutoscaleSettings |
| 輸送量 | 每秒要求單位數。 例如,「輸送量」:10000。 | 整數 (int) |
SqlTriggerCreateUpdatePropertiesOrSqlTriggerGetProperties
| 名字 | 描述 | 價值 |
|---|---|---|
| 選項 | 要套用要求之選項的索引鍵/值組。 這會對應至隨要求傳送的標頭。 | CreateUpdateOptions |
| 資源 | 觸發程式的標準 JSON 格式 | SqlTriggerResourceOrSqlTriggerGetPropertiesResource (必要) |
SqlTriggerResourceOrSqlTriggerGetPropertiesResource
| 名字 | 描述 | 價值 |
|---|---|---|
| 身體 | 觸發程序的主體 | 字串 |
| 識別碼 | Cosmos DB SQL 觸發程式的名稱 | 字串 (必要) |
| triggerOperation | 觸發程式相關聯的作業 | '全部' “創建” '刪除' '替換' “更新” |
| triggerType | 觸發程式的類型 | '發佈' 'Pre' |
標籤
| 名字 | 描述 | 價值 |
|---|
使用範例
Terraform 範例
部署 SQL 觸發程式的基本範例。
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"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "databaseAccount" {
type = "Microsoft.DocumentDB/databaseAccounts@2021-10-15"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
kind = "GlobalDocumentDB"
properties = {
capabilities = [
]
consistencyPolicy = {
defaultConsistencyLevel = "Session"
maxIntervalInSeconds = 5
maxStalenessPrefix = 100
}
databaseAccountOfferType = "Standard"
defaultIdentity = "FirstPartyIdentity"
disableKeyBasedMetadataWriteAccess = false
disableLocalAuth = false
enableAnalyticalStorage = false
enableAutomaticFailover = false
enableFreeTier = false
enableMultipleWriteLocations = false
ipRules = [
]
isVirtualNetworkFilterEnabled = false
locations = [
{
failoverPriority = 0
isZoneRedundant = false
locationName = "West Europe"
},
]
networkAclBypass = "None"
networkAclBypassResourceIds = [
]
publicNetworkAccess = "Enabled"
virtualNetworkRules = [
]
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "sqlDatabase" {
type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2021-10-15"
parent_id = azapi_resource.databaseAccount.id
name = var.resource_name
body = {
properties = {
options = {
}
resource = {
id = var.resource_name
}
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "container" {
type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers@2023-04-15"
parent_id = azapi_resource.sqlDatabase.id
name = var.resource_name
body = {
properties = {
options = {
}
resource = {
id = var.resource_name
partitionKey = {
kind = "Hash"
paths = [
"/definition/id",
]
}
}
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "trigger" {
type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/triggers@2021-10-15"
parent_id = azapi_resource.container.id
name = var.resource_name
body = {
properties = {
options = {
}
resource = {
body = "function trigger(){}"
id = var.resource_name
triggerOperation = "All"
triggerType = "Pre"
}
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}