共用方式為


Microsoft.DocumentDB 資料庫Accounts/mongodbDatabases/collections 2021-10-15-preview

Bicep 資源定義

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

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

資源格式

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

resource symbolicname 'Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections@2021-10-15-preview' = {
  parent: resourceSymbolicName
  identity: {
    type: 'string'
    userAssignedIdentities: {
      {customized property}: {}
    }
  }
  location: 'string'
  name: 'string'
  properties: {
    options: {
      autoscaleSettings: {
        maxThroughput: int
      }
      throughput: int
    }
    resource: {
      analyticalStorageTtl: int
      id: 'string'
      indexes: [
        {
          key: {
            keys: [
              'string'
            ]
          }
          options: {
            expireAfterSeconds: int
            unique: bool
          }
        }
      ]
      shardKey: {
        {customized property}: 'string'
      }
    }
  }
  tags: {
    {customized property}: 'string'
  }
}

屬性值

AutoscaleSettings

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

Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties

名字 描述 價值

CreateUpdateOptionsOrMongoDBCollectionGetPropertiesOptions

名字 描述 價值
autoscaleSettings 指定自動調整設定。 AutoscaleSettings
輸送量 每秒要求單位數。 例如,「輸送量」:10000。 int

ManagedServiceIdentity

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

ManagedServiceIdentityUserAssignedIdentities

名字 描述 價值

Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections

名字 描述 價值
身份 資源的身分識別。 ManagedServiceIdentity
位置 資源所屬資源群組的位置。 字串
名字 資源名稱 字串 (必要)
父母 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。

如需詳細資訊,請參閱 父資源外部的子資源
類型資源的符號名稱:databaseAccounts/mongodbDatabases
性能 用來建立及更新 Azure Cosmos DB MongoDB 集合的屬性。 MongoDBCollectionCreateUpdatePropertiesOrMongoDBCollectionGetProperties (必要)
標籤 資源標籤 標記名稱和值的字典。 請參閱範本中的 標籤

MongoDBCollectionCreateUpdatePropertiesOrMongoDBCollectionGetProperties

名字 描述 價值
選項 要套用要求之選項的索引鍵/值組。 這會對應至隨要求傳送的標頭。 CreateUpdateOptionsOrMongoDBCollectionGetPropertiesOptions
資源 MongoDB 集合的標準 JSON 格式 MongoDBCollectionResourceOrMongoDBCollectionGetPropertiesResource (必要)

MongoDBCollectionResourceOrMongoDBCollectionGetPropertiesResource

名字 描述 價值
分析StorageTtl 分析TTL。 int
id Cosmos DB MongoDB 集合的名稱 字串 (必要)
指標 索引鍵清單 MongoIndex[]
shardKey 要套用要求之分區索引鍵的索引鍵/值組。 ShardKeys

MongoIndex

名字 描述 價值
鑰匙 Cosmos DB MongoDB 集合索引鍵 MongoIndexKeys
選項 Cosmos DB MongoDB 集合索引鍵選項 MongoIndexOptions

MongoIndexKeys

名字 描述 價值
鑰匙 Azure Cosmos DB 服務中每個 MongoDB 集合的密鑰清單 string[]

MongoIndexOptions

名字 描述 價值
expireAfterSeconds 秒後到期 int
獨特 是唯一或不是唯一的 bool

ShardKeys

名字 描述 價值

標籤

名字 描述 價值

使用範例

Azure 快速入門範例

下列 Azure 快速入門範本 包含用於部署此資源類型的 Bicep 範例。

Bicep 檔案 描述
建立適用於 MongoDB API 的 Azure Cosmos 帳戶 此範本會在兩個區域中建立適用於 MongoDB API 4.2 的 Azure Cosmos DB 帳戶,並使用具有兩個集合的共用和專用輸送量。
建立適用於 MongoDB API 的 Azure Cosmos 帳戶自動調整 此範本會使用共用和專用的自動調整輸送量,在兩個區域中建立 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": "2021-10-15-preview",
  "name": "string",
  "identity": {
    "type": "string",
    "userAssignedIdentities": {
      "{customized property}": {
      }
    }
  },
  "location": "string",
  "properties": {
    "options": {
      "autoscaleSettings": {
        "maxThroughput": "int"
      },
      "throughput": "int"
    },
    "resource": {
      "analyticalStorageTtl": "int",
      "id": "string",
      "indexes": [
        {
          "key": {
            "keys": [ "string" ]
          },
          "options": {
            "expireAfterSeconds": "int",
            "unique": "bool"
          }
        }
      ],
      "shardKey": {
        "{customized property}": "string"
      }
    }
  },
  "tags": {
    "{customized property}": "string"
  }
}

屬性值

AutoscaleSettings

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

Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties

名字 描述 價值

CreateUpdateOptionsOrMongoDBCollectionGetPropertiesOptions

名字 描述 價值
autoscaleSettings 指定自動調整設定。 AutoscaleSettings
輸送量 每秒要求單位數。 例如,「輸送量」:10000。 int

ManagedServiceIdentity

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

ManagedServiceIdentityUserAssignedIdentities

名字 描述 價值

Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections

名字 描述 價值
apiVersion API 版本 '2021-10-15-preview'
身份 資源的身分識別。 ManagedServiceIdentity
位置 資源所屬資源群組的位置。 字串
名字 資源名稱 字串 (必要)
性能 用來建立及更新 Azure Cosmos DB MongoDB 集合的屬性。 MongoDBCollectionCreateUpdatePropertiesOrMongoDBCollectionGetProperties (必要)
標籤 資源標籤 標記名稱和值的字典。 請參閱範本中的 標籤
類型 資源類型 'Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections'

MongoDBCollectionCreateUpdatePropertiesOrMongoDBCollectionGetProperties

名字 描述 價值
選項 要套用要求之選項的索引鍵/值組。 這會對應至隨要求傳送的標頭。 CreateUpdateOptionsOrMongoDBCollectionGetPropertiesOptions
資源 MongoDB 集合的標準 JSON 格式 MongoDBCollectionResourceOrMongoDBCollectionGetPropertiesResource (必要)

MongoDBCollectionResourceOrMongoDBCollectionGetPropertiesResource

名字 描述 價值
分析StorageTtl 分析TTL。 int
id Cosmos DB MongoDB 集合的名稱 字串 (必要)
指標 索引鍵清單 MongoIndex[]
shardKey 要套用要求之分區索引鍵的索引鍵/值組。 ShardKeys

MongoIndex

名字 描述 價值
鑰匙 Cosmos DB MongoDB 集合索引鍵 MongoIndexKeys
選項 Cosmos DB MongoDB 集合索引鍵選項 MongoIndexOptions

MongoIndexKeys

名字 描述 價值
鑰匙 Azure Cosmos DB 服務中每個 MongoDB 集合的密鑰清單 string[]

MongoIndexOptions

名字 描述 價值
expireAfterSeconds 秒後到期 int
獨特 是唯一或不是唯一的 bool

ShardKeys

名字 描述 價值

標籤

名字 描述 價值

使用範例

Azure 快速入門範本

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

範本 描述
建立適用於 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@2021-10-15-preview"
  name = "string"
  identity = {
    type = "string"
    userAssignedIdentities = {
      {customized property} = {
      }
    }
  }
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = jsonencode({
    properties = {
      options = {
        autoscaleSettings = {
          maxThroughput = int
        }
        throughput = int
      }
      resource = {
        analyticalStorageTtl = int
        id = "string"
        indexes = [
          {
            key = {
              keys = [
                "string"
              ]
            }
            options = {
              expireAfterSeconds = int
              unique = bool
            }
          }
        ]
        shardKey = {
          {customized property} = "string"
        }
      }
    }
  })
}

屬性值

AutoscaleSettings

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

Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties

名字 描述 價值

CreateUpdateOptionsOrMongoDBCollectionGetPropertiesOptions

名字 描述 價值
autoscaleSettings 指定自動調整設定。 AutoscaleSettings
輸送量 每秒要求單位數。 例如,「輸送量」:10000。 int

ManagedServiceIdentity

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

ManagedServiceIdentityUserAssignedIdentities

名字 描述 價值

Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections

名字 描述 價值
身份 資源的身分識別。 ManagedServiceIdentity
位置 資源所屬資源群組的位置。 字串
名字 資源名稱 字串 (必要)
parent_id 此資源為父系之資源的標識碼。 類型資源的標識碼:databaseAccounts/mongodbDatabases
性能 用來建立及更新 Azure Cosmos DB MongoDB 集合的屬性。 MongoDBCollectionCreateUpdatePropertiesOrMongoDBCollectionGetProperties (必要)
標籤 資源標籤 標記名稱和值的字典。
類型 資源類型 “Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections@2021-10-15-preview”

MongoDBCollectionCreateUpdatePropertiesOrMongoDBCollectionGetProperties

名字 描述 價值
選項 要套用要求之選項的索引鍵/值組。 這會對應至隨要求傳送的標頭。 CreateUpdateOptionsOrMongoDBCollectionGetPropertiesOptions
資源 MongoDB 集合的標準 JSON 格式 MongoDBCollectionResourceOrMongoDBCollectionGetPropertiesResource (必要)

MongoDBCollectionResourceOrMongoDBCollectionGetPropertiesResource

名字 描述 價值
分析StorageTtl 分析TTL。 int
id Cosmos DB MongoDB 集合的名稱 字串 (必要)
指標 索引鍵清單 MongoIndex[]
shardKey 要套用要求之分區索引鍵的索引鍵/值組。 ShardKeys

MongoIndex

名字 描述 價值
鑰匙 Cosmos DB MongoDB 集合索引鍵 MongoIndexKeys
選項 Cosmos DB MongoDB 集合索引鍵選項 MongoIndexOptions

MongoIndexKeys

名字 描述 價值
鑰匙 Azure Cosmos DB 服務中每個 MongoDB 集合的密鑰清單 string[]

MongoIndexOptions

名字 描述 價值
expireAfterSeconds 秒後到期 int
獨特 是唯一或不是唯一的 bool

ShardKeys

名字 描述 價值

標籤

名字 描述 價值