Skip to content

Commit 615259b

Browse files
authored
Support UserAssigned MSI for CosmosDB (#10306)
* Support UserAssigned MSI for CosmosDB * add examples * Prettify * Prettier Fix
1 parent 7a8e546 commit 615259b

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed

specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2020-06-01-preview/cosmos-db.json

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5663,6 +5663,9 @@
56635663
"properties": {
56645664
"x-ms-client-flatten": true,
56655665
"$ref": "#/definitions/DatabaseAccountUpdateProperties"
5666+
},
5667+
"identity": {
5668+
"$ref": "#/definitions/ManagedServiceIdentity"
56665669
}
56675670
}
56685671
},
@@ -7024,17 +7027,36 @@
70247027
},
70257028
"type": {
70267029
"type": "string",
7027-
"description": "The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service.",
7030+
"description": "The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service.",
70287031
"enum": [
70297032
"SystemAssigned",
70307033
"UserAssigned",
7031-
"SystemAssigned, UserAssigned",
7034+
"SystemAssigned,UserAssigned",
70327035
"None"
70337036
],
70347037
"x-ms-enum": {
70357038
"name": "ResourceIdentityType",
70367039
"modelAsString": false
70377040
}
7041+
},
7042+
"userAssignedIdentities": {
7043+
"type": "object",
7044+
"additionalProperties": {
7045+
"type": "object",
7046+
"properties": {
7047+
"principalId": {
7048+
"readOnly": true,
7049+
"type": "string",
7050+
"description": "The principal id of user assigned identity."
7051+
},
7052+
"clientId": {
7053+
"readOnly": true,
7054+
"type": "string",
7055+
"description": "The client id of user assigned identity."
7056+
}
7057+
}
7058+
},
7059+
"description": "The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'."
70387060
}
70397061
},
70407062
"description": "Identity for the resource."

specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2020-06-01-preview/examples/CosmosDBDatabaseAccountCreateMax.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
"location": "westus",
99
"tags": {},
1010
"kind": "MongoDB",
11+
"identity": {
12+
"type": "SystemAssigned,UserAssigned",
13+
"userAssignedIdentities": {
14+
"/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}
15+
}
16+
},
1117
"properties": {
1218
"databaseAccountOfferType": "Standard",
1319
"ipRules": [
@@ -73,6 +79,15 @@
7379
"type": "Microsoft.DocumentDB/databaseAccounts",
7480
"kind": "MongoDB",
7581
"tags": {},
82+
"identity": {
83+
"type": "SystemAssigned,UserAssigned",
84+
"userAssignedIdentities": {
85+
"/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {
86+
"clientId": "fbe75b66-01c5-4f87-a220-233af3270436",
87+
"principalId": "075a0ca6-43f6-4434-9abf-c9b1b79f9219"
88+
}
89+
}
90+
},
7691
"properties": {
7792
"provisioningState": "Initializing",
7893
"isVirtualNetworkFilterEnabled": true,

specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2020-06-01-preview/examples/CosmosDBDatabaseAccountPatch.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
"tags": {
1010
"dept": "finance"
1111
},
12+
"identity": {
13+
"type": "SystemAssigned,UserAssigned",
14+
"userAssignedIdentities": {
15+
"/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}
16+
}
17+
},
1218
"properties": {
1319
"ipRules": [
1420
{
@@ -53,6 +59,15 @@
5359
"tags": {
5460
"dept": "finance"
5561
},
62+
"identity": {
63+
"type": "SystemAssigned,UserAssigned",
64+
"userAssignedIdentities": {
65+
"/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {
66+
"clientId": "fbe75b66-01c5-4f87-a220-233af3270436",
67+
"principalId": "075a0ca6-43f6-4434-9abf-c9b1b79f9219"
68+
}
69+
}
70+
},
5671
"properties": {
5772
"provisioningState": "Succeeded",
5873
"documentEndpoint": "https://ddb1.documents.azure.com:443/",

0 commit comments

Comments
 (0)