Snažím se používat ARM šablony aktualizovat indexování politiku pro vesmír kontejneru. Zkoušel jsem 2 způsoby, jeden jednoduše deklarovat politiku indexování a zároveň prohlašuje kontejner v ruce.
{
apiVersion: [variables('cosmosDbApiVersion')],
type: Microsoft.DocumentDB/databaseAccounts/apis/databases/containers,
dependsOn: [ /* resourceId */ ],
name: /* containerName */,
properties: {
resource: {
id: /* id */,
partitionKey: {
paths: [
/partitionKey
],
kind: Hash
},
indexes: [
{
indexingMode: consistent,
automatic: true,
includedPaths: [
{
path: /*,
indexes: [
{
kind: Range,
dataType: Number,
precision: -1
},
{
kind: Hash,
dataType: String,
precision: 3
}
]
}
]
}
],
defaultTtl: [variables('defaultTtlValueToEnableTtl')]
}
}
},
Druhým bylo použít pouze ARM nastavení nasadit kontejner jako takový:
{
apiVersion: [variables('cosmosDbApiVersion')],
type: Microsoft.DocumentDB/databaseAccounts/apis/databases/containers/settings,
name: [/* name */,
dependsOn: [ /* container name */ ],
properties: {
resource: {
throughput: /* some throughput */,
indexes: [
{
indexingMode: consistent,
automatic: true,
includedPaths: [
{
path: /*,
indexes: [
{
kind: Range,
dataType: Number,
precision: -1
},
{
kind: Hash,
dataType: String,
precision: 3
}
]
}
]
}
]
}
}
},
Obě techniky nedojde k nasazení, ale indexování politika nezmění.
Chtěl bych ocenit pomoc.