Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Microsoft.DocumentDB - lack of property autoscaleSettings in GET of mongodbDatabases #31085

Open
dj-r1 opened this issue Oct 17, 2024 · 1 comment
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@dj-r1
Copy link

dj-r1 commented Oct 17, 2024

API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/cosmos-db.json

API Spec version

2024-08-15, 2024-02-15-preview

Describe the bug

In a ARM template (Bicep) of Microsoft.DocumentDB/databaseAccounts/mongodbDatabases

{
  "type": "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases",
  "apiVersion": "2024-05-15",
  "name": "string",
  "location": "string",
...
  "properties": {
    "options": {
      "autoscaleSettings": {
        "maxThroughput": "int"
      },
      "throughput": "int"
    },
    "resource": {
      "createMode": "string",
      "id": "string",
...
    }
  }
}

points out that CreateUpdateOptionsOrMongoDBDatabaseGetPropertiesOptions is a part of the template, so in GET request it may be in a response, but in az rest and az cosmosdb mongodb database show response is not.

Example CosmosDBMongoDBDatabaseGet.json has a response with main properties of the resource without CreateUpdateOptionsOrMongoDBDatabaseGetPropertiesOptions. In Cosmos DB REST API - Get a Database it's the same.

In my case I struggle with What-If operation response showing me lack of autoscaleSettings.maxThroughput in Azure, where it's set and valid. I assume arm-template-whatif receives information from Azure REST API and compares it with my generated ARM template (Bicep).

Should CreateUpdateOptionsOrMongoDBDatabaseGetPropertiesOptions be a part of GET mongoDB database? Or could you guide me to the root cause?

I know that there is a separate Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/mongodbCollections/throughputSettings extension resource with adequate example CosmosDBMongoDBCollectionThroughputGet.json. In my case I tried use it, but without good result.

Expected behavior

{
  "id": "/subscriptions/aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb/resourceGroups/my-rg/providers/Microsoft.DocumentDB/databaseAccounts/my-cosmos-account/mongodbDatabases/my-mongo-db",
  "name": "my-mongo-db",
  "properties": {
    "options": {
      "autoscaleSettings": {
        "maxThroughput": 1000
      }
    },
    "resource": {
      "id": "my-mongo-db"
    }
  },
  "type": "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases"
}

Actual behavior

{
  "id": "/subscriptions/aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb/resourceGroups/my-rg/providers/Microsoft.DocumentDB/databaseAccounts/my-cosmos-account/mongodbDatabases/my-mongo-db",
  "name": "my-mongo-db",
  "properties": {
    "resource": {
      "id": "my-mongo-db"
    }
  },
  "type": "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases"
}

Reproduction Steps

az cosmosdb mongodb database show --resource-group 'my-rg' --name 'my-mongo-db' --account-name 'my-cosmos-account' 

||
az rest --method get --header "Accept=application/json" --url 'https://management.azure.com/subscriptions/aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb/resourceGroups/my-rg/providers/Microsoft.DocumentDB/databaseAccounts/my-cosmos-account/mongodbDatabases/my-mongo-db?api-version=2024-08-15'
||
GET https://management.azure.com/subscriptions/aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb/resourceGroups/my-rg/providers/Microsoft.DocumentDB/databaseAccounts/my-cosmos-account/mongodbDatabases/my-mongo-db?api-version=2024-08-15

Environment

No response

@dj-r1 dj-r1 added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Oct 17, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Oct 17, 2024
@v-jiaodi v-jiaodi added the Mgmt This issue is related to a management-plane library. label Oct 18, 2024
@v-jiaodi
Copy link
Member

@carjackson-msft Please help take a look, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants