Share via


Microsoft.DocumentDB 資料庫Accounts/mongodbDatabases/collections 2023-11-15-preview

Bicep 資源定義

databaseAccounts/mongodbDatabases/collections 資源類型可以使用目標作業來部署:

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

資源格式

若要建立 Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections 資源,請將下列 Bicep 新增至您的範本。

resource symbolicname 'Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections@2023-11-15-preview' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  parent: resourceSymbolicName
  identity: {
    type: 'string'
    userAssignedIdentities: {
      {customized property}: {}
    }
  }
  properties: {
    options: {
      autoscaleSettings: {
        maxThroughput: int
      }
      throughput: int
    }
    resource: {
      analyticalStorageTtl: int
      createMode: 'string'
      id: 'string'
      indexes: [
        {
          key: {
            keys: [
              'string'
            ]
          }
          options: {
            expireAfterSeconds: int
            unique: bool
          }
        }
      ]
      restoreParameters: {
        restoreSource: 'string'
        restoreTimestampInUtc: 'string'
      }
      shardKey: {
        {customized property}: 'string'
      }
    }
  }
}

屬性值

databaseAccounts/mongodbDatabases/collections

名稱 描述
NAME 資源名稱

瞭解如何在 Bicep 中設定子資源的名稱和類型。
需要字串 ()
location 資源所屬之資源群組的位置。 字串
tags 標記是描述資源的索引鍵/值組清單。 這些標記可用來在資源群組間檢視資源,以及對資源分組。 資源最多可提供15個標記。 每個標記的金鑰都不得多於 128 個字元,值則不得多於 256 個字元。 例如,範本類型的默認體驗會設定為 「defaultExperience」:“Cassandra” 目前的 「defaultExperience」 值也包括 「Table」、“Graph”、“DocumentDB” 和 “MongoDB”。 標記名稱和值的字典。 請參閱 範本中的標籤
父系 (parent) 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增此屬性。

如需詳細資訊,請參閱 父資源外部的子資源
類型資源的符號名稱: mongodbDatabases
身分識別 資源的身分識別。 ManagedServiceIdentity
properties 用來建立和更新 Azure Cosmos DB MongoDB 集合的屬性。 MongoDBCollectionCreateUpdatePropertiesOrMongoDBColl... 必要 ()

ManagedServiceIdentity

名稱 描述
類型 'None'
'SystemAssigned'
'SystemAssigned,UserAssigned'
'UserAssigned':用於資源的身分識別類型。 類型 'SystemAssigned,UserAssigned' 同時包含隱含建立的身分識別和一組使用者指派的身分識別。 類型 『None』 會從服務中移除任何身分識別。
userAssignedIdentities 與資源相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。 ManagedServiceIdentityUserAssignedIdentities

ManagedServiceIdentityUserAssignedIdentities

名稱 描述
{自定義屬性} Components1Jq1T4ISchemasManagedserviceidentityProper...

Components1Jq1T4ISchemasManagedserviceidentityProper...

此物件不包含部署期間要設定的任何屬性。 所有屬性都是 ReadOnly。

MongoDBCollectionCreateUpdatePropertiesOrMongoDBColl...

名稱 描述
選項 要套用要求之選項的索引鍵/值組。 這會對應至與要求一起傳送的標頭。 CreateUpdateOptionsOrMongoDBCollectionGetPropertiesO...
資源 MongoDB 集合的標準 JSON 格式 MongoDBCollectionResourceOrMongoDBCollectionGetPrope... 必要 ()

CreateUpdateOptionsOrMongoDBCollectionGetPropertiesO...

名稱 描述
autoscaleSettings 指定自動調整設定。 注意:需要輸送量或 autoscaleSettings,但不需要兩者。 AutoscaleSettings
輸送量 每秒要求單位數。 例如,「輸送量」:10000。 int

AutoscaleSettings

名稱 描述
maxThroughput 代表最大輸送量,資源可以相應增加。 int

MongoDBCollectionResourceOrMongoDBCollectionGetPrope...

名稱 描述
分析StorageTtl 分析TTL。 int
createMode 表示資源建立模式的列舉。 'Default'
'PointInTimeRestore'
'Restore'
id Cosmos DB MongoDB 集合的名稱 字串 (必要)
索引 索引鍵清單 MongoIndex[]
restoreParameters 用來指出還原相關信息的參數 ResourceRestoreParameters
shardKey 要套用要求之分區索引鍵的索引鍵/值組。 ShardKeys

MongoIndex

名稱 描述
索引鍵 Cosmos DB MongoDB 集合索引鍵 MongoIndexKeys
選項 Cosmos DB MongoDB 集合索引鍵選項 MongoIndexOptions

MongoIndexKeys

名稱 描述
金鑰 Azure Cosmos DB 服務中每個 MongoDB 集合的密鑰清單 string[]

MongoIndexOptions

名稱 描述
expireAfterSeconds 在秒後到期 int
unique 是唯一或不是唯一的 bool

ResourceRestoreParameters

名稱 描述
restoreSource 必須起始還原之可還原之資料庫帳戶的標識碼。 例如:/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName} 字串
restoreTimestampInUtc 帳戶必須還原的時間 (ISO-8601 格式) 。 字串

ShardKeys

名稱 描述
{自定義屬性} 字串

快速入門範本

下列快速入門範本會部署此資源類型。

範本 描述
建立適用於 MongoDB API 的 Azure Cosmos 帳戶

部署至 Azure
此範本會在兩個區域中建立 MongoDB API 4.2 的 Azure Cosmos DB 帳戶,並使用共用和專用輸送量搭配兩個集合。
建立適用於 MongoDB API 自動調整的 Azure Cosmos 帳戶

部署至 Azure
此範本會使用共用和專用的自動調整輸送量,在兩個區域中建立 MongoDB API 4.2 的 Azure Cosmos DB 帳戶。

ARM 範本資源定義

databaseAccounts/mongodbDatabases/collections 資源類型可以使用目標作業來部署:

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

資源格式

若要建立 Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections 資源,請將下列 JSON 新增至您的範本。

{
  "type": "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections",
  "apiVersion": "2023-11-15-preview",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "identity": {
    "type": "string",
    "userAssignedIdentities": {
      "{customized property}": {}
    }
  },
  "properties": {
    "options": {
      "autoscaleSettings": {
        "maxThroughput": "int"
      },
      "throughput": "int"
    },
    "resource": {
      "analyticalStorageTtl": "int",
      "createMode": "string",
      "id": "string",
      "indexes": [
        {
          "key": {
            "keys": [ "string" ]
          },
          "options": {
            "expireAfterSeconds": "int",
            "unique": "bool"
          }
        }
      ],
      "restoreParameters": {
        "restoreSource": "string",
        "restoreTimestampInUtc": "string"
      },
      "shardKey": {
        "{customized property}": "string"
      }
    }
  }
}

屬性值

databaseAccounts/mongodbDatabases/collections

名稱 描述
類型 資源類型 'Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections'
apiVersion 資源 API 版本 '2023-11-15-preview'
NAME 資源名稱

請參閱如何在 JSON ARM 樣本中設定子資源的名稱和類型。
字串 (必要)
location 資源所屬資源群組的位置。 字串
tags 標籤是描述資源的索引鍵/值組清單。 這些標記可用來在資源群組間檢視資源,以及對資源分組。 資源最多可提供15個標籤。 每個標記的金鑰都不得多於 128 個字元,值則不得多於 256 個字元。 例如,範本類型的默認體驗設定為 「defaultExperience」:“Cassandra” 目前的 「defaultExperience」 值也包括 「Table」、“Graph”、“DocumentDB” 和 “MongoDB”。 標記名稱和值的字典。 請參閱 範本中的標記
身分識別 資源的身分識別。 ManagedServiceIdentity
properties 用來建立及更新 Azure Cosmos DB MongoDB 集合的屬性。 MongoDBCollectionCreateUpdatePropertiesOrMongoDBColl... 必要 ()

ManagedServiceIdentity

名稱 描述
類型 'None'
'SystemAssigned'
'SystemAssigned,UserAssigned'
'UserAssigned':用於資源的身分識別類型。 類型 'SystemAssigned,UserAssigned' 同時包含隱含建立的身分識別和一組使用者指派的身分識別。 類型 『None』 會從服務中移除任何身分識別。
userAssignedIdentities 與資源相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。 ManagedServiceIdentityUserAssignedIdentities

ManagedServiceIdentityUserAssignedIdentities

名稱 描述
{自定義屬性} Components1Jq1T4ISchemasManagedserviceidentityProper...

Components1Jq1T4ISchemasManagedserviceidentityProper...

此物件不包含部署期間要設定的任何屬性。 所有屬性都是 ReadOnly。

MongoDBCollectionCreateUpdatePropertiesOrMongoDBColl...

名稱 描述
選項 要套用要求之選項的索引鍵/值組。 這會對應至與要求一起傳送的標頭。 CreateUpdateOptionsOrMongoDBCollectionGetPropertiesO...
資源 MongoDB 集合的標準 JSON 格式 MongoDBCollectionResourceOrMongoDBCollectionGetPrope... 必要 ()

CreateUpdateOptionsOrMongoDBCollectionGetPropertiesO...

名稱 描述
autoscaleSettings 指定自動調整設定。 注意:需要輸送量或 autoscaleSettings,但不需要兩者。 AutoscaleSettings
輸送量 每秒要求單位數。 例如,「輸送量」:10000。 int

AutoscaleSettings

名稱 描述
maxThroughput 代表最大輸送量,資源可以相應增加。 int

MongoDBCollectionResourceOrMongoDBCollectionGetPrope...

名稱 描述
分析StorageTtl 分析TTL。 int
createMode 列舉,表示資源建立模式。 'Default'
'PointInTimeRestore'
'Restore'
id Cosmos DB MongoDB 集合的名稱 需要字串 ()
索引 索引鍵清單 MongoIndex[]
restoreParameters 用來指出還原相關信息的參數 ResourceRestoreParameters
shardKey 要套用要求之分區索引鍵的索引鍵/值組。 ShardKeys

MongoIndex

名稱 描述
索引鍵 Cosmos DB MongoDB 集合索引鍵 MongoIndexKeys
選項 Cosmos DB MongoDB 集合索引鍵選項 MongoIndexOptions

MongoIndexKeys

名稱 描述
金鑰 Azure Cosmos DB 服務中每個 MongoDB 集合的密鑰清單 string[]

MongoIndexOptions

名稱 描述
expireAfterSeconds 在秒後到期 int
unique 是唯一或不是唯一的 bool

ResourceRestoreParameters

名稱 描述
restoreSource 必須起始還原之可還原資料庫帳戶的標識碼。 例如:/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName} 字串
restoreTimestampInUtc 帳戶必須還原的時間 (ISO-8601 格式) 。 字串

ShardKeys

名稱 描述
{自定義屬性} 字串

快速入門範本

下列快速入門範本會部署此資源類型。

範本 描述
建立適用於 MongoDB API 的 Azure Cosmos 帳戶

部署至 Azure
此範本會在兩個區域中,使用具有兩個集合的共用和專用輸送量,為 MongoDB API 4.2 建立 Azure Cosmos DB 帳戶。
建立適用於 MongoDB API 自動調整的 Azure Cosmos 帳戶

部署至 Azure
此範本會使用共用和專用的自動調整輸送量,在兩個區域中建立 MongoDB API 4.2 的 Azure Cosmos DB 帳戶。

Terraform (AzAPI 提供者) 資源定義

databaseAccounts/mongodbDatabases/collections 資源類型可以使用目標作業來部署:

  • 資源群組

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

資源格式

若要建立 Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections 資源,請將下列 Terraform 新增至您的範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections@2023-11-15-preview"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  identity {
    type = "string"
    identity_ids = []
  }
  body = jsonencode({
    properties = {
      options = {
        autoscaleSettings = {
          maxThroughput = int
        }
        throughput = int
      }
      resource = {
        analyticalStorageTtl = int
        createMode = "string"
        id = "string"
        indexes = [
          {
            key = {
              keys = [
                "string"
              ]
            }
            options = {
              expireAfterSeconds = int
              unique = bool
            }
          }
        ]
        restoreParameters = {
          restoreSource = "string"
          restoreTimestampInUtc = "string"
        }
        shardKey = {
          {customized property} = "string"
        }
      }
    }
  })
}

屬性值

databaseAccounts/mongodbDatabases/collections

名稱 描述
類型 資源類型 “Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections@2023-11-15-preview”
NAME 資源名稱 需要字串 ()
location 資源所屬之資源群組的位置。 字串
parent_id 此資源父系之資源的標識碼。 類型資源的標識碼: mongodbDatabases
tags 標記是描述資源的索引鍵/值組清單。 這些標記可用來在資源群組間檢視資源,以及對資源分組。 資源最多可提供15個標記。 每個標記的金鑰都不得多於 128 個字元,值則不得多於 256 個字元。 例如,範本類型的默認體驗會設定為 「defaultExperience」:“Cassandra” 目前的 「defaultExperience」 值也包括 「Table」、“Graph”、“DocumentDB” 和 “MongoDB”。 標記名稱和值的字典。
身分識別 資源的身分識別。 ManagedServiceIdentity
properties 用來建立和更新 Azure Cosmos DB MongoDB 集合的屬性。 MongoDBCollectionCreateUpdatePropertiesOrMongoDBColl... 必要 ()

ManagedServiceIdentity

名稱 描述
類型 “SystemAssigned”
“SystemAssigned,UserAssigned”
“UserAssigned”:用於資源的身分識別類型。 類型 「SystemAssigned,UserAssigned」 包含隱含建立的身分識別和一組使用者指派的身分識別。 類型 「None」 會從服務中移除任何身分識別。
identity_ids 與資源相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。 使用者身分識別標識碼的陣列。

ManagedServiceIdentityUserAssignedIdentities

名稱 描述
{自定義屬性} Components1Jq1T4ISchemasManagedserviceidentityProper...

Components1Jq1T4ISchemasManagedserviceidentityProper...

此物件不包含部署期間要設定的任何屬性。 所有屬性都是 ReadOnly。

MongoDBCollectionCreateUpdatePropertiesOrMongoDBColl...

名稱 描述
選項 要套用要求之選項的索引鍵/值組。 這會對應至與要求一起傳送的標頭。 CreateUpdateOptionsOrMongoDBCollectionGetPropertiesO...
資源 MongoDB 集合的標準 JSON 格式 MongoDBCollectionResourceOrMongoDBCollectionGetPrope... 必要 ()

CreateUpdateOptionsOrMongoDBCollectionGetPropertiesO...

名稱 描述
autoscaleSettings 指定自動調整設定。 注意:需要輸送量或 autoscaleSettings,但不需要兩者。 AutoscaleSettings
輸送量 每秒要求單位數。 例如,「輸送量」:10000。 int

AutoscaleSettings

名稱 描述
maxThroughput 代表最大輸送量,資源可以相應增加為 。 int

MongoDBCollectionResourceOrMongoDBCollectionGetPrope...

名稱 描述
分析StorageTtl 分析TTL。 int
createMode 列舉,表示資源建立模式。 “預設值”
“PointInTimeRestore”
“還原”
id Cosmos DB MongoDB 集合的名稱 需要字串 ()
索引 索引鍵清單 MongoIndex[]
restoreParameters 用來指出還原相關信息的參數 ResourceRestoreParameters
shardKey 要套用要求之分區索引鍵的索引鍵/值組。 ShardKeys

MongoIndex

名稱 描述
索引鍵 Cosmos DB MongoDB 集合索引鍵 MongoIndexKeys
選項 Cosmos DB MongoDB 集合索引鍵選項 MongoIndexOptions

MongoIndexKeys

名稱 描述
金鑰 Azure Cosmos DB 服務中每個 MongoDB 集合的密鑰清單 string[]

MongoIndexOptions

名稱 描述
expireAfterSeconds 在秒後到期 int
unique 是唯一或不是唯一的 bool

ResourceRestoreParameters

名稱 描述
restoreSource 必須起始還原之可還原資料庫帳戶的標識碼。 例如:/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName} 字串
restoreTimestampInUtc 帳戶必須還原的時間 (ISO-8601 格式) 。 字串

ShardKeys

名稱 描述
{自定義屬性} 字串