When I try to enable the capability "EnableUniqueIndexReIndex", I always get the error message "Invalid capability EnableUniqueIndexReIndex".
I tried with the az cli
and with the bicep script that deploys the application. I have installed the cosmosdb az extension in the preview version.
$ az extension add --name cosmosdb-preview --allow-preview true
Extension 'cosmosdb-preview' 1.0.1 is already installed.
$ az cosmosdb update --resource-group <rg> --name <dbacc> --capabilities EnableMongo EnableServerless EnableUniqueIndexReIndex
The behavior of this command has been altered by the following extension: cosmosdb-preview (BadRequest) Invalid capability EnableUniqueIndexReIndex. ActivityId: <id>, Microsoft.Azure.Documents.Common/2.14.0 Code: BadRequest Message: Invalid capability EnableUniqueIndexReIndex. ActivityId: <id>, Microsoft.Azure.Documents.Common/2.14.0
When deploying with the bicep code:
resource dbacc 'Microsoft.DocumentDB/databaseAccounts@2024-05-15' = {
name: parNomeDBACC
location: parLocal
kind: 'MongoDB'
properties: {
consistencyPolicy: {
defaultConsistencyLevel: 'Eventual'
}
locations: [
{
locationName: parLocal
failoverPriority: 0
isZoneRedundant: false
}
]
databaseAccountOfferType: 'Standard'
apiProperties: {
serverVersion: '4.2'
}
capabilities: [
{
name: 'EnableServerless'
}
{
name: 'EnableUniqueIndexReIndex'
}
]
}
tags: {
componente: 'database'
regiao: parLocal
projeto: parNomeProjeto
}
}
It gives as the result:
{"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/<id>/providers/Microsoft.Resources/deployments/criaDev","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ResourceDeploymentFailure","target":"/subscriptions/<id>/resourceGroups/<rg>/providers/Microsoft.Resources/deployments/criaDatabaseAccount","message":"The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.","details":[{"code":"DeploymentFailed","target":"/subscriptions/<id>/resourceGroups/<rg>/providers/Microsoft.Resources/deployments/criaDatabaseAccount","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"BadRequest","target":"/subscriptions/<id>/resourceGroups/<rg>/providers/Microsoft.DocumentDB/databaseAccounts/dbaccruraltechgeosyncdev","message":"{\r\n \"code\": \"BadRequest\",\r\n \"message\": \"Invalid capability EnableUniqueIndexReIndex.\\r\\nActivityId: <id>, Microsoft.Azure.Documents.Common/2.14.0\"\r\n}"}]}]}]}}
My versions are:
$ az version --output table
Azure-cli Azure-cli-core Azure-cli-telemetry
----------- ---------------- ---------------------
2.64.0 2.64.0 1.1.0
$ az extension show --name cosmosdb-preview --output table
ExtensionType Name Path Version
--------------- ---------------- --------------------------------------------------- ---------
whl cosmosdb-preview /home/haroldo/.azure/cliextensions/cosmosdb-preview 1.0.1