Azure / Azure/azure-rest-api-specs

CosmosDB Account API should allow "userAssignedIdentities = null" when "identity.type" is "None"

Open
#25,222 0 comments 1 reaction 0 assignees View on GitHub
Cosmos Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

Hi team,

We found that CosmosDB Account API in version 2023-04-15 doesn't allow "userAssignedIdentities = null" when "identity.type" is "None". And service API would fail with below error while creating CosmosDB Account with "userAssignedIdentities = null" and "identity.type = None". I assume the backend service should allow "userAssignedIdentities = null" when "identity.type" is "None".

Request payload:
```
PUT https://management.azure.com/subscriptions/{{subscriptionId}}/resourceGroups/acctestRG-cosmos-test10/providers/Microsoft.DocumentDB/databaseAccounts/acctest-ca-test10?api-version=2023-04-15

{
"identity": {
"type": "None",
"userAssignedIdentities": null
},
"kind": "GlobalDocumentDB",
"location": "westeurope",
"properties": {
"backupPolicy": null,
"capabilities": [],
"consistencyPolicy": {
"defaultConsistencyLevel": "Session",
"maxIntervalInSeconds": 5,
"maxStalenessPrefix": 100
},
"databaseAccountOfferType": "Standard",
"disableKeyBasedMetadataWriteAccess": false,
"disableLocalAuth": false,
"enableAnalyticalStorage": false,
"enableAutomaticFailover": false,
"enableFreeTier": false,
"enableMultipleWriteLocations": false,
"ipRules": [],
"isVirtualNetworkFilterEnabled": false,
"locations": [
{
"failoverPriority": 0,
"isZoneRedundant": false,
"locationName": "westeurope"
}
],
"networkAclBypass": "None",
"networkAclBypassResourceIds": [],
"publicNetworkAccess": "Enabled",
"virtualNetworkRules": []
},
"tags": {}
}
```

Error Message:
```
{
"message": "Object reference not set to an instance of an object.",
"code": "Internal Server Error"
}
```

Contributor guide

Open the contributing guide

Research direction

No repository file, test, or entry point is named. Start by locating the CosmosDB 2023-04-15 account identity definition in the REST API specifications and checking how null is represented; done means the intended handling of userAssignedIdentities when identity.type is None is reflected in the API contract and its relevant validation path.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
api, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.