- Latest
- 2026-04-01-預覽
- 2026-03-15
- 2025-11-01-預覽
- 2025-10-15
- 2025-05-01-preview
- 2025-04-15
- 2024-12-01-preview
- 2024-11-15
- 2024-09-01-preview
- 2024-08-15
- 2024-05-15
- 2024-05-15-preview
- 2024-02-15-preview
- 2023-11-15
- 2023-11-15-preview
- 2023-09-15
- 2023-09-15-preview
- 2023-04-15
- 2023-03-15
- 2023-03-15-preview
- 2023-03-01-preview
- 2022-11-15
- 2022-11-15-preview
- 2022-08-15
- 2022-08-15-preview
- 2022-05-15
- 2022-05-15-preview
- 2022-02-15-preview
- 2021-11-15-preview
- 2021-10-15
- 2021-10-15-preview
- 2021-07-01-preview
- 2021-06-15
- 2021-05-15
- 2021-04-15
- 2021-04-01-preview
- 2021-03-15
- 2021-03-01-preview
- 2021-01-15
- 2020-09-01
- 2020-06-01-preview
- 2020-04-01
- 2020-03-01
- 2019-12-12
- 2019-08-01
Bicep 資源定義
databaseAccounts/gremlinDatabases/graphs 資源類型可以使用目標作業來部署:
- 資源群組 - 請參閱 資源群組部署命令
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
使用範例
Bicep 範例
在 Cosmos DB 帳戶內部署 Gremlin Graph 的基本範例。
param resourceName string = 'acctest0001'
param location string = 'westeurope'
resource databaseAccount 'Microsoft.DocumentDB/databaseAccounts@2021-10-15' = {
name: resourceName
location: location
kind: 'GlobalDocumentDB'
properties: {
capabilities: [
{
name: 'EnableGremlin'
}
]
consistencyPolicy: {
defaultConsistencyLevel: 'Strong'
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: []
}
}
resource gremlinDatabase 'Microsoft.DocumentDB/databaseAccounts/gremlinDatabases@2023-04-15' = {
name: resourceName
parent: databaseAccount
properties: {
options: {}
resource: {
id: resourceName
}
}
}
resource graph 'Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs@2023-04-15' = {
name: resourceName
parent: gremlinDatabase
properties: {
options: {
throughput: 400
}
resource: {
id: resourceName
partitionKey: {
kind: 'Hash'
paths: [
'/test'
]
}
}
}
}
Azure 快速入門範例
下列 Azure 快速入門範本 包含用於部署此資源類型的 Bicep 範例。
| Bicep 檔 | Description |
|---|---|
| 為 Gremlin API 建立 Azure Cosmos DB 帳戶 | 此範本會在兩個區域中建立適用於 Gremlin API 的 Azure Cosmos DB 帳戶,其中一個資料庫和一個圖表使用專用輸送量。 |
| 為 Gremlin API 自動調整 建立 Azure Cosmos DB 帳戶 | 此範本會使用自動調整輸送量,在兩個區域中建立 Gremlin API 的 Azure Cosmos DB 帳戶,其中一個資料庫和一個圖形。 |
資源格式
若要建立 Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs 資源,請將下列 Bicep 新增至範本。
resource symbolicname 'Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs@2025-11-01-preview' = {
parent: resourceSymbolicName
identity: {
type: 'string'
userAssignedIdentities: {
{customized property}: {}
}
}
location: 'string'
name: 'string'
properties: {
options: {
autoscaleSettings: {
maxThroughput: int
}
throughput: int
}
resource: {
analyticalStorageTtl: int
conflictResolutionPolicy: {
conflictResolutionPath: 'string'
conflictResolutionProcedure: 'string'
mode: 'string'
}
createMode: 'string'
defaultTtl: int
id: 'string'
indexingPolicy: {
automatic: bool
compositeIndexes: [
[
{
order: 'string'
path: 'string'
}
]
]
excludedPaths: [
{
path: 'string'
}
]
fullTextIndexes: [
{
path: 'string'
}
]
includedPaths: [
{
indexes: [
{
dataType: 'string'
kind: 'string'
precision: int
}
]
path: 'string'
}
]
indexingMode: 'string'
spatialIndexes: [
{
path: 'string'
types: [
'string'
]
}
]
vectorIndexes: [
{
indexingSearchListSize: int
path: 'string'
quantizationByteSize: int
type: 'string'
vectorIndexShardKey: [
'string'
]
}
]
}
partitionKey: {
kind: 'string'
paths: [
'string'
]
version: int
}
restoreParameters: {
restoreSource: 'string'
restoreTimestampInUtc: 'string'
restoreWithTtlDisabled: bool
}
uniqueKeyPolicy: {
uniqueKeys: [
{
paths: [
'string'
]
}
]
}
}
}
tags: {
{customized property}: 'string'
}
}
屬性值
Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs
| 名稱 | Description | 價值觀 |
|---|---|---|
| 身分識別 | 資源的身分識別。 | ManagedServiceIdentity |
| 位置 | 資源所屬資源群組的位置。 | 字串 |
| 名稱 | 資源名稱 | 字串(必填) |
| 父代 | 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。 如需詳細資訊,請參閱 父資源外部的子資源。 |
類型的資源符號名稱:databaseAccounts/gremlinDatabases |
| properties | 用來建立及更新 Azure Cosmos DB Gremlin 圖形的屬性。 | GremlinGraphCreateUpdatePropertiesOrGremlinGraphGetProperties (必要) |
| tags | 資源標籤 | 標記名稱和值的字典。 請參閱範本中的 標籤 |
ARMResourceProperties標籤
| 名稱 | Description | 價值觀 |
|---|
AutoscaleSettings
| 名稱 | Description | 價值觀 |
|---|---|---|
| maxThroughput (最大輸送量) | 代表最大輸送量,資源可以相應增加至 。 | int |
複合路徑
| 名稱 | Description | 價值觀 |
|---|---|---|
| 順序 | 複合路徑的排序順序。 | '上升' '下降' |
| 路徑 | 索引行為套用的路徑。 索引路徑通常以根開頭,並以通配符結尾 (/path/*) | 字串 |
ConflictResolutionPolicy (衝突解決策略)
| 名稱 | Description | 價值觀 |
|---|---|---|
| conflictResolutionPath 衝突解決路徑 | LastWriterWins 模式的衝突解決路徑。 | 字串 |
| conflictResolutionProcedure | 解決自定義模式衝突的程式。 | 字串 |
| mode | 表示衝突解決模式。 | 'Custom' 'LastWriterWins' |
ContainerPartitionKey
| 名稱 | Description | 價值觀 |
|---|---|---|
| 類型 | 表示用於數據分割的演算法類型。 針對 MultiHash,容器建立支援多個分割區索引鍵 (最多三個最大值) | '哈希' '多哈希' '範圍' |
| 路徑 | 使用容器內可分割數據的路徑清單 | 字串[] |
| 版本 | 指出分割區索引鍵定義的版本 | int Constraints: 最小值 = 1 最大值 = 2 |
CreateUpdateOptionsOrGremlinGraphGetPropertiesOptions
| 名稱 | Description | 價值觀 |
|---|---|---|
| autoscaleSettings | 指定自動調整設定。 注意:需要輸送量或自動調整設定,但不需要兩者。 | AutoscaleSettings |
| 輸送量 | 每秒要求單位數。 例如,「輸送量」:10000。 | int |
排除路徑
| 名稱 | Description | 價值觀 |
|---|---|---|
| 路徑 | 索引行為套用的路徑。 索引路徑通常以根開頭,並以通配符結尾 (/path/*) | 字串 |
全文索引路徑
| 名稱 | Description | 價值觀 |
|---|---|---|
| 路徑 | 檔中全文檢索欄位的路徑。 | 字串(必填) |
GremlinGraphCreateUpdatePropertiesOrGremlinGraphGetProperties
| 名稱 | Description | 價值觀 |
|---|---|---|
| options | 要套用要求之選項的索引鍵/值組。 這會對應至隨要求傳送的標頭。 | CreateUpdateOptionsOrGremlinGraphGetPropertiesOptions |
| 資源 | Gremlin 圖形的標準 JSON 格式 | GremlinGraphResourceOrGremlinGraphGetPropertiesResource (必要) |
GremlinGraphResourceOrGremlinGraphGetPropertiesResource
| 名稱 | Description | 價值觀 |
|---|---|---|
| 分析StorageTtl | 分析TTL。 | int |
| conflictResolutionPolicy (衝突解決策略) | 圖形的衝突解決原則。 | ConflictResolutionPolicy (衝突解決策略) |
| createMode | 列舉,表示資源建立模式。 | 'Default' 'Restore' |
| defaultTtl | 默認存留時間 | int |
| 識別碼 | Cosmos DB Gremlin 圖形的名稱 | 字串(必填) |
| indexingPolicy (索引策略) | 編製索引原則的組態。 根據預設,圖表內所有文件路徑的索引會自動編製索引 | 索引策略 |
| partitionKey | 分割區索引鍵的組態,用於將數據分割成多個分割區 | ContainerPartitionKey |
| restoreParameters | 用來指出還原相關信息的參數 | 資源恢復參數 |
| uniqueKeyPolicy 的 | 針對 Azure Cosmos DB 服務集合中檔指定唯一性條件約束的唯一索引鍵原則組態。 | UniqueKeyPolicy (唯一金鑰策略) |
包含路徑
| 名稱 | Description | 價值觀 |
|---|---|---|
| 指標 | 此路徑的索引清單 | 索引[] |
| 路徑 | 索引行為套用的路徑。 索引路徑通常以根開頭,並以通配符結尾 (/path/*) | 字串 |
Indexes
| 名稱 | Description | 價值觀 |
|---|---|---|
| 數據類型 | 套用索引行為的數據類型。 | 'LineString' 'MultiPolygon' (多多邊形) '數位' “點” '多邊形' '字串' |
| 類型 | 表示索引的類型。 | '哈希' '範圍' “空間” |
| 精確度 | 索引的有效位數。 -1 是最大精確度。 | int |
索引政策
| 名稱 | Description | 價值觀 |
|---|---|---|
| 自動 | 指出索引編製原則是否為自動 | 布爾 (bool) |
| 複合索引 | 複合路徑清單清單 | CompositePath[][] |
| excludedPaths | 要從索引編製中排除的路徑清單 | ExcludedPath[] |
| fullText索引 | 要包含在全文索引中的路徑清單 | 全文索引路徑[] |
| includedPaths | 要包含在索引中的路徑清單 | IncludedPath[] |
| indexingMode | 表示索引模式。 | “始終如一” '懶惰' 'none' |
| 空間索引 | 空間特定項目清單 | 空間規格 |
| vectorIndexes 的 | 要包含在向量索引中的路徑清單 | 向量索引[] |
ManagedServiceIdentity
| 名稱 | Description | 價值觀 |
|---|---|---|
| 型別 | 用於資源的身分識別類型。 類型 'SystemAssigned,UserAssigned' 包含隱含建立的身分識別和一組使用者指派的身分識別。 類型 『None』 會從服務中移除任何身分識別。 | 'None' 'SystemAssigned' 'SystemAssigned,UserAssigned' 'UserAssigned' |
| userAssignedIdentities | 與資源相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。 | ManagedServiceIdentityUserAssignedIdentities |
ManagedServiceIdentityUserAssignedIdentities
| 名稱 | Description | 價值觀 |
|---|
ManagedServiceIdentityUserAssignedIdentities
| 名稱 | Description | 價值觀 |
|---|
資源恢復參數
| 名稱 | Description | 價值觀 |
|---|---|---|
| restoreSource | 必須起始還原的可還原資料庫帳戶標識碼。 例如:/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName} | 字串 |
| restoreTimestampInUtc | 帳戶必須還原的時間(ISO-8601 格式)。 | 字串 |
| restoreWithTtlDisabled | 指定還原的帳戶是否會在成功還原時停用時間To-Live。 | 布爾 (bool) |
空間規格
| 名稱 | Description | 價值觀 |
|---|---|---|
| 路徑 | 索引行為套用的路徑。 索引路徑通常以根開頭,並以通配符結尾 (/path/*) | 字串 |
| 類型 | 路徑的空間類型清單 | 包含任何的字串數組: 'LineString' 'MultiPolygon' (多多邊形) “點” '多邊形' |
唯一鍵
| 名稱 | Description | 價值觀 |
|---|---|---|
| 路徑 | Azure Cosmos DB 服務中每個文件的路徑清單必須是唯一的 | 字串[] |
UniqueKeyPolicy (唯一金鑰策略)
| 名稱 | Description | 價值觀 |
|---|---|---|
| uniqueKeys 的 | 上唯一索引鍵的清單,該索引鍵會對 Azure Cosmos DB 服務集合中的文件強制執行唯一性條件約束。 | UniqueKey[] |
向量索引
| 名稱 | Description | 價值觀 |
|---|---|---|
| indexingSearchListSize | 這是在最佳化程序中建置 DiskANN 索引時儲存的近似鄰居候選清單的大小。 較大的值可能會以延遲為代價來改善召回率。 這僅適用於 diskANN 向量索引類型。 | int Constraints: 最小值 = 25 最大值 = 500 |
| 路徑 | 檔中向量欄位的路徑。 | 字串(必填) |
| 量化位元組大小 | 向量乘積量化中使用的位元組數。 較大的值可能會導致向量搜尋的更好召回率,但會犧牲延遲。 這僅適用於 quantizedFlat 和 diskANN 向量索引類型。 | int Constraints: 最小值 = 4 |
| 型別 | 向量的索引類型。 目前支援一般、diskANN 和 quantizedFlat。 | “diskANN” 'flat' 'quantizedFlat' (必要) |
| vectorIndexShardKey | 向量索引的碎片索引鍵陣列。 這僅適用於 quantizedFlat 和 diskANN 向量索引類型。 | 字串[] |
ARM 樣本資源定義
databaseAccounts/gremlinDatabases/graphs 資源類型可以使用目標作業來部署:
使用範例
Azure 快速入門範本
下列 Azure 快速入門範本 部署此資源類型。
| Template | Description |
|---|---|
|
為 Gremlin API 建立 Azure Cosmos DB 帳戶 |
此範本會在兩個區域中建立適用於 Gremlin API 的 Azure Cosmos DB 帳戶,其中一個資料庫和一個圖表使用專用輸送量。 |
|
為 Gremlin API 自動調整 建立 Azure Cosmos DB 帳戶 |
此範本會使用自動調整輸送量,在兩個區域中建立 Gremlin API 的 Azure Cosmos DB 帳戶,其中一個資料庫和一個圖形。 |
資源格式
若要建立 Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs 資源,請將下列 JSON 新增至範本。
{
"type": "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs",
"apiVersion": "2025-11-01-preview",
"name": "string",
"identity": {
"type": "string",
"userAssignedIdentities": {
"{customized property}": {
}
}
},
"location": "string",
"properties": {
"options": {
"autoscaleSettings": {
"maxThroughput": "int"
},
"throughput": "int"
},
"resource": {
"analyticalStorageTtl": "int",
"conflictResolutionPolicy": {
"conflictResolutionPath": "string",
"conflictResolutionProcedure": "string",
"mode": "string"
},
"createMode": "string",
"defaultTtl": "int",
"id": "string",
"indexingPolicy": {
"automatic": "bool",
"compositeIndexes": [
[
{
"order": "string",
"path": "string"
}
]
],
"excludedPaths": [
{
"path": "string"
}
],
"fullTextIndexes": [
{
"path": "string"
}
],
"includedPaths": [
{
"indexes": [
{
"dataType": "string",
"kind": "string",
"precision": "int"
}
],
"path": "string"
}
],
"indexingMode": "string",
"spatialIndexes": [
{
"path": "string",
"types": [ "string" ]
}
],
"vectorIndexes": [
{
"indexingSearchListSize": "int",
"path": "string",
"quantizationByteSize": "int",
"type": "string",
"vectorIndexShardKey": [ "string" ]
}
]
},
"partitionKey": {
"kind": "string",
"paths": [ "string" ],
"version": "int"
},
"restoreParameters": {
"restoreSource": "string",
"restoreTimestampInUtc": "string",
"restoreWithTtlDisabled": "bool"
},
"uniqueKeyPolicy": {
"uniqueKeys": [
{
"paths": [ "string" ]
}
]
}
}
},
"tags": {
"{customized property}": "string"
}
}
屬性值
Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs
| 名稱 | Description | 價值觀 |
|---|---|---|
| apiVersion | API 版本 | 「2025-11-01-預覽」 |
| 身分識別 | 資源的身分識別。 | ManagedServiceIdentity |
| 位置 | 資源所屬資源群組的位置。 | 字串 |
| 名稱 | 資源名稱 | 字串(必填) |
| properties | 用來建立及更新 Azure Cosmos DB Gremlin 圖形的屬性。 | GremlinGraphCreateUpdatePropertiesOrGremlinGraphGetProperties (必要) |
| tags | 資源標籤 | 標記名稱和值的字典。 請參閱範本中的 標籤 |
| 型別 | 資源類型 | “Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs” |
ARMResourceProperties標籤
| 名稱 | Description | 價值觀 |
|---|
AutoscaleSettings
| 名稱 | Description | 價值觀 |
|---|---|---|
| maxThroughput (最大輸送量) | 代表最大輸送量,資源可以相應增加至 。 | int |
複合路徑
| 名稱 | Description | 價值觀 |
|---|---|---|
| 順序 | 複合路徑的排序順序。 | '上升' '下降' |
| 路徑 | 索引行為套用的路徑。 索引路徑通常以根開頭,並以通配符結尾 (/path/*) | 字串 |
ConflictResolutionPolicy (衝突解決策略)
| 名稱 | Description | 價值觀 |
|---|---|---|
| conflictResolutionPath 衝突解決路徑 | LastWriterWins 模式的衝突解決路徑。 | 字串 |
| conflictResolutionProcedure | 解決自定義模式衝突的程式。 | 字串 |
| mode | 表示衝突解決模式。 | 'Custom' 'LastWriterWins' |
ContainerPartitionKey
| 名稱 | Description | 價值觀 |
|---|---|---|
| 類型 | 表示用於數據分割的演算法類型。 針對 MultiHash,容器建立支援多個分割區索引鍵 (最多三個最大值) | '哈希' '多哈希' '範圍' |
| 路徑 | 使用容器內可分割數據的路徑清單 | 字串[] |
| 版本 | 指出分割區索引鍵定義的版本 | int Constraints: 最小值 = 1 最大值 = 2 |
CreateUpdateOptionsOrGremlinGraphGetPropertiesOptions
| 名稱 | Description | 價值觀 |
|---|---|---|
| autoscaleSettings | 指定自動調整設定。 注意:需要輸送量或自動調整設定,但不需要兩者。 | AutoscaleSettings |
| 輸送量 | 每秒要求單位數。 例如,「輸送量」:10000。 | int |
排除路徑
| 名稱 | Description | 價值觀 |
|---|---|---|
| 路徑 | 索引行為套用的路徑。 索引路徑通常以根開頭,並以通配符結尾 (/path/*) | 字串 |
全文索引路徑
| 名稱 | Description | 價值觀 |
|---|---|---|
| 路徑 | 檔中全文檢索欄位的路徑。 | 字串(必填) |
GremlinGraphCreateUpdatePropertiesOrGremlinGraphGetProperties
| 名稱 | Description | 價值觀 |
|---|---|---|
| options | 要套用要求之選項的索引鍵/值組。 這會對應至隨要求傳送的標頭。 | CreateUpdateOptionsOrGremlinGraphGetPropertiesOptions |
| 資源 | Gremlin 圖形的標準 JSON 格式 | GremlinGraphResourceOrGremlinGraphGetPropertiesResource (必要) |
GremlinGraphResourceOrGremlinGraphGetPropertiesResource
| 名稱 | Description | 價值觀 |
|---|---|---|
| 分析StorageTtl | 分析TTL。 | int |
| conflictResolutionPolicy (衝突解決策略) | 圖形的衝突解決原則。 | ConflictResolutionPolicy (衝突解決策略) |
| createMode | 列舉,表示資源建立模式。 | 'Default' 'Restore' |
| defaultTtl | 默認存留時間 | int |
| 識別碼 | Cosmos DB Gremlin 圖形的名稱 | 字串(必填) |
| indexingPolicy (索引策略) | 編製索引原則的組態。 根據預設,圖表內所有文件路徑的索引會自動編製索引 | 索引策略 |
| partitionKey | 分割區索引鍵的組態,用於將數據分割成多個分割區 | ContainerPartitionKey |
| restoreParameters | 用來指出還原相關信息的參數 | 資源恢復參數 |
| uniqueKeyPolicy 的 | 針對 Azure Cosmos DB 服務集合中檔指定唯一性條件約束的唯一索引鍵原則組態。 | UniqueKeyPolicy (唯一金鑰策略) |
包含路徑
| 名稱 | Description | 價值觀 |
|---|---|---|
| 指標 | 此路徑的索引清單 | 索引[] |
| 路徑 | 索引行為套用的路徑。 索引路徑通常以根開頭,並以通配符結尾 (/path/*) | 字串 |
Indexes
| 名稱 | Description | 價值觀 |
|---|---|---|
| 數據類型 | 套用索引行為的數據類型。 | 'LineString' 'MultiPolygon' (多多邊形) '數位' “點” '多邊形' '字串' |
| 類型 | 表示索引的類型。 | '哈希' '範圍' “空間” |
| 精確度 | 索引的有效位數。 -1 是最大精確度。 | int |
索引政策
| 名稱 | Description | 價值觀 |
|---|---|---|
| 自動 | 指出索引編製原則是否為自動 | 布爾 (bool) |
| 複合索引 | 複合路徑清單清單 | CompositePath[][] |
| excludedPaths | 要從索引編製中排除的路徑清單 | ExcludedPath[] |
| fullText索引 | 要包含在全文索引中的路徑清單 | 全文索引路徑[] |
| includedPaths | 要包含在索引中的路徑清單 | IncludedPath[] |
| indexingMode | 表示索引模式。 | “始終如一” '懶惰' 'none' |
| 空間索引 | 空間特定項目清單 | 空間規格 |
| vectorIndexes 的 | 要包含在向量索引中的路徑清單 | 向量索引[] |
ManagedServiceIdentity
| 名稱 | Description | 價值觀 |
|---|---|---|
| 型別 | 用於資源的身分識別類型。 類型 'SystemAssigned,UserAssigned' 包含隱含建立的身分識別和一組使用者指派的身分識別。 類型 『None』 會從服務中移除任何身分識別。 | 'None' 'SystemAssigned' 'SystemAssigned,UserAssigned' 'UserAssigned' |
| userAssignedIdentities | 與資源相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。 | ManagedServiceIdentityUserAssignedIdentities |
ManagedServiceIdentityUserAssignedIdentities
| 名稱 | Description | 價值觀 |
|---|
ManagedServiceIdentityUserAssignedIdentities
| 名稱 | Description | 價值觀 |
|---|
資源恢復參數
| 名稱 | Description | 價值觀 |
|---|---|---|
| restoreSource | 必須起始還原的可還原資料庫帳戶標識碼。 例如:/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName} | 字串 |
| restoreTimestampInUtc | 帳戶必須還原的時間(ISO-8601 格式)。 | 字串 |
| restoreWithTtlDisabled | 指定還原的帳戶是否會在成功還原時停用時間To-Live。 | 布爾 (bool) |
空間規格
| 名稱 | Description | 價值觀 |
|---|---|---|
| 路徑 | 索引行為套用的路徑。 索引路徑通常以根開頭,並以通配符結尾 (/path/*) | 字串 |
| 類型 | 路徑的空間類型清單 | 包含任何的字串數組: 'LineString' 'MultiPolygon' (多多邊形) “點” '多邊形' |
唯一鍵
| 名稱 | Description | 價值觀 |
|---|---|---|
| 路徑 | Azure Cosmos DB 服務中每個文件的路徑清單必須是唯一的 | 字串[] |
UniqueKeyPolicy (唯一金鑰策略)
| 名稱 | Description | 價值觀 |
|---|---|---|
| uniqueKeys 的 | 上唯一索引鍵的清單,該索引鍵會對 Azure Cosmos DB 服務集合中的文件強制執行唯一性條件約束。 | UniqueKey[] |
向量索引
| 名稱 | Description | 價值觀 |
|---|---|---|
| indexingSearchListSize | 這是在最佳化程序中建置 DiskANN 索引時儲存的近似鄰居候選清單的大小。 較大的值可能會以延遲為代價來改善召回率。 這僅適用於 diskANN 向量索引類型。 | int Constraints: 最小值 = 25 最大值 = 500 |
| 路徑 | 檔中向量欄位的路徑。 | 字串(必填) |
| 量化位元組大小 | 向量乘積量化中使用的位元組數。 較大的值可能會導致向量搜尋的更好召回率,但會犧牲延遲。 這僅適用於 quantizedFlat 和 diskANN 向量索引類型。 | int Constraints: 最小值 = 4 |
| 型別 | 向量的索引類型。 目前支援一般、diskANN 和 quantizedFlat。 | “diskANN” 'flat' 'quantizedFlat' (必要) |
| vectorIndexShardKey | 向量索引的碎片索引鍵陣列。 這僅適用於 quantizedFlat 和 diskANN 向量索引類型。 | 字串[] |
Terraform (AzAPI 提供者) 資源定義
databaseAccounts/gremlinDatabases/graphs 資源類型可以使用目標作業來部署:
- 資源團體 關於每個 API 版本變更屬性的清單,請參見 變更日誌。
使用範例
Terraform 範例
在 Cosmos DB 帳戶內部署 Gremlin Graph 的基本範例。
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 = [
{
name = "EnableGremlin"
},
]
consistencyPolicy = {
defaultConsistencyLevel = "Strong"
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" "gremlinDatabase" {
type = "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases@2023-04-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" "graph" {
type = "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs@2023-04-15"
parent_id = azapi_resource.gremlinDatabase.id
name = var.resource_name
body = {
properties = {
options = {
throughput = 400
}
resource = {
id = var.resource_name
partitionKey = {
kind = "Hash"
paths = [
"/test",
]
}
}
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
資源格式
若要建立 Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs 資源,請將下列 Terraform 新增至範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs@2025-11-01-preview"
name = "string"
parent_id = "string"
identity {
type = "string"
identity_ids = [
"string"
]
}
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
options = {
autoscaleSettings = {
maxThroughput = int
}
throughput = int
}
resource = {
analyticalStorageTtl = int
conflictResolutionPolicy = {
conflictResolutionPath = "string"
conflictResolutionProcedure = "string"
mode = "string"
}
createMode = "string"
defaultTtl = int
id = "string"
indexingPolicy = {
automatic = bool
compositeIndexes = [
[
{
order = "string"
path = "string"
}
]
]
excludedPaths = [
{
path = "string"
}
]
fullTextIndexes = [
{
path = "string"
}
]
includedPaths = [
{
indexes = [
{
dataType = "string"
kind = "string"
precision = int
}
]
path = "string"
}
]
indexingMode = "string"
spatialIndexes = [
{
path = "string"
types = [
"string"
]
}
]
vectorIndexes = [
{
indexingSearchListSize = int
path = "string"
quantizationByteSize = int
type = "string"
vectorIndexShardKey = [
"string"
]
}
]
}
partitionKey = {
kind = "string"
paths = [
"string"
]
version = int
}
restoreParameters = {
restoreSource = "string"
restoreTimestampInUtc = "string"
restoreWithTtlDisabled = bool
}
uniqueKeyPolicy = {
uniqueKeys = [
{
paths = [
"string"
]
}
]
}
}
}
}
}
屬性值
Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs
| 名稱 | Description | 價值觀 |
|---|---|---|
| 身分識別 | 資源的身分識別。 | ManagedServiceIdentity |
| 位置 | 資源所屬資源群組的位置。 | 字串 |
| 名稱 | 資源名稱 | 字串(必填) |
| parent_id | 此資源為父系之資源的標識碼。 | 類型資源的標識碼:databaseAccounts/gremlinDatabases |
| properties | 用來建立及更新 Azure Cosmos DB Gremlin 圖形的屬性。 | GremlinGraphCreateUpdatePropertiesOrGremlinGraphGetProperties (必要) |
| tags | 資源標籤 | 標記名稱和值的字典。 |
| 型別 | 資源類型 | 「Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs@2025-11-01-preview」 |
ARMResourceProperties標籤
| 名稱 | Description | 價值觀 |
|---|
AutoscaleSettings
| 名稱 | Description | 價值觀 |
|---|---|---|
| maxThroughput (最大輸送量) | 代表最大輸送量,資源可以相應增加至 。 | int |
複合路徑
| 名稱 | Description | 價值觀 |
|---|---|---|
| 順序 | 複合路徑的排序順序。 | '上升' '下降' |
| 路徑 | 索引行為套用的路徑。 索引路徑通常以根開頭,並以通配符結尾 (/path/*) | 字串 |
ConflictResolutionPolicy (衝突解決策略)
| 名稱 | Description | 價值觀 |
|---|---|---|
| conflictResolutionPath 衝突解決路徑 | LastWriterWins 模式的衝突解決路徑。 | 字串 |
| conflictResolutionProcedure | 解決自定義模式衝突的程式。 | 字串 |
| mode | 表示衝突解決模式。 | 'Custom' 'LastWriterWins' |
ContainerPartitionKey
| 名稱 | Description | 價值觀 |
|---|---|---|
| 類型 | 表示用於數據分割的演算法類型。 針對 MultiHash,容器建立支援多個分割區索引鍵 (最多三個最大值) | '哈希' '多哈希' '範圍' |
| 路徑 | 使用容器內可分割數據的路徑清單 | 字串[] |
| 版本 | 指出分割區索引鍵定義的版本 | int Constraints: 最小值 = 1 最大值 = 2 |
CreateUpdateOptionsOrGremlinGraphGetPropertiesOptions
| 名稱 | Description | 價值觀 |
|---|---|---|
| autoscaleSettings | 指定自動調整設定。 注意:需要輸送量或自動調整設定,但不需要兩者。 | AutoscaleSettings |
| 輸送量 | 每秒要求單位數。 例如,「輸送量」:10000。 | int |
排除路徑
| 名稱 | Description | 價值觀 |
|---|---|---|
| 路徑 | 索引行為套用的路徑。 索引路徑通常以根開頭,並以通配符結尾 (/path/*) | 字串 |
全文索引路徑
| 名稱 | Description | 價值觀 |
|---|---|---|
| 路徑 | 檔中全文檢索欄位的路徑。 | 字串(必填) |
GremlinGraphCreateUpdatePropertiesOrGremlinGraphGetProperties
| 名稱 | Description | 價值觀 |
|---|---|---|
| options | 要套用要求之選項的索引鍵/值組。 這會對應至隨要求傳送的標頭。 | CreateUpdateOptionsOrGremlinGraphGetPropertiesOptions |
| 資源 | Gremlin 圖形的標準 JSON 格式 | GremlinGraphResourceOrGremlinGraphGetPropertiesResource (必要) |
GremlinGraphResourceOrGremlinGraphGetPropertiesResource
| 名稱 | Description | 價值觀 |
|---|---|---|
| 分析StorageTtl | 分析TTL。 | int |
| conflictResolutionPolicy (衝突解決策略) | 圖形的衝突解決原則。 | ConflictResolutionPolicy (衝突解決策略) |
| createMode | 列舉,表示資源建立模式。 | 'Default' 'Restore' |
| defaultTtl | 默認存留時間 | int |
| 識別碼 | Cosmos DB Gremlin 圖形的名稱 | 字串(必填) |
| indexingPolicy (索引策略) | 編製索引原則的組態。 根據預設,圖表內所有文件路徑的索引會自動編製索引 | 索引策略 |
| partitionKey | 分割區索引鍵的組態,用於將數據分割成多個分割區 | ContainerPartitionKey |
| restoreParameters | 用來指出還原相關信息的參數 | 資源恢復參數 |
| uniqueKeyPolicy 的 | 針對 Azure Cosmos DB 服務集合中檔指定唯一性條件約束的唯一索引鍵原則組態。 | UniqueKeyPolicy (唯一金鑰策略) |
包含路徑
| 名稱 | Description | 價值觀 |
|---|---|---|
| 指標 | 此路徑的索引清單 | 索引[] |
| 路徑 | 索引行為套用的路徑。 索引路徑通常以根開頭,並以通配符結尾 (/path/*) | 字串 |
Indexes
| 名稱 | Description | 價值觀 |
|---|---|---|
| 數據類型 | 套用索引行為的數據類型。 | 'LineString' 'MultiPolygon' (多多邊形) '數位' “點” '多邊形' '字串' |
| 類型 | 表示索引的類型。 | '哈希' '範圍' “空間” |
| 精確度 | 索引的有效位數。 -1 是最大精確度。 | int |
索引政策
| 名稱 | Description | 價值觀 |
|---|---|---|
| 自動 | 指出索引編製原則是否為自動 | 布爾 (bool) |
| 複合索引 | 複合路徑清單清單 | CompositePath[][] |
| excludedPaths | 要從索引編製中排除的路徑清單 | ExcludedPath[] |
| fullText索引 | 要包含在全文索引中的路徑清單 | 全文索引路徑[] |
| includedPaths | 要包含在索引中的路徑清單 | IncludedPath[] |
| indexingMode | 表示索引模式。 | “始終如一” '懶惰' 'none' |
| 空間索引 | 空間特定項目清單 | 空間規格 |
| vectorIndexes 的 | 要包含在向量索引中的路徑清單 | 向量索引[] |
ManagedServiceIdentity
| 名稱 | Description | 價值觀 |
|---|---|---|
| 型別 | 用於資源的身分識別類型。 類型 'SystemAssigned,UserAssigned' 包含隱含建立的身分識別和一組使用者指派的身分識別。 類型 『None』 會從服務中移除任何身分識別。 | 'None' 'SystemAssigned' 'SystemAssigned,UserAssigned' 'UserAssigned' |
| userAssignedIdentities | 與資源相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。 | ManagedServiceIdentityUserAssignedIdentities |
ManagedServiceIdentityUserAssignedIdentities
| 名稱 | Description | 價值觀 |
|---|
ManagedServiceIdentityUserAssignedIdentities
| 名稱 | Description | 價值觀 |
|---|
資源恢復參數
| 名稱 | Description | 價值觀 |
|---|---|---|
| restoreSource | 必須起始還原的可還原資料庫帳戶標識碼。 例如:/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName} | 字串 |
| restoreTimestampInUtc | 帳戶必須還原的時間(ISO-8601 格式)。 | 字串 |
| restoreWithTtlDisabled | 指定還原的帳戶是否會在成功還原時停用時間To-Live。 | 布爾 (bool) |
空間規格
| 名稱 | Description | 價值觀 |
|---|---|---|
| 路徑 | 索引行為套用的路徑。 索引路徑通常以根開頭,並以通配符結尾 (/path/*) | 字串 |
| 類型 | 路徑的空間類型清單 | 包含任何的字串數組: 'LineString' 'MultiPolygon' (多多邊形) “點” '多邊形' |
唯一鍵
| 名稱 | Description | 價值觀 |
|---|---|---|
| 路徑 | Azure Cosmos DB 服務中每個文件的路徑清單必須是唯一的 | 字串[] |
UniqueKeyPolicy (唯一金鑰策略)
| 名稱 | Description | 價值觀 |
|---|---|---|
| uniqueKeys 的 | 上唯一索引鍵的清單,該索引鍵會對 Azure Cosmos DB 服務集合中的文件強制執行唯一性條件約束。 | UniqueKey[] |
向量索引
| 名稱 | Description | 價值觀 |
|---|---|---|
| indexingSearchListSize | 這是在最佳化程序中建置 DiskANN 索引時儲存的近似鄰居候選清單的大小。 較大的值可能會以延遲為代價來改善召回率。 這僅適用於 diskANN 向量索引類型。 | int Constraints: 最小值 = 25 最大值 = 500 |
| 路徑 | 檔中向量欄位的路徑。 | 字串(必填) |
| 量化位元組大小 | 向量乘積量化中使用的位元組數。 較大的值可能會導致向量搜尋的更好召回率,但會犧牲延遲。 這僅適用於 quantizedFlat 和 diskANN 向量索引類型。 | int Constraints: 最小值 = 4 |
| 型別 | 向量的索引類型。 目前支援一般、diskANN 和 quantizedFlat。 | “diskANN” 'flat' 'quantizedFlat' (必要) |
| vectorIndexShardKey | 向量索引的碎片索引鍵陣列。 這僅適用於 quantizedFlat 和 diskANN 向量索引類型。 | 字串[] |