05-06-2024 12:27 AM
Hi All,
I want to add a member to a group in databricks account level using rest api (https://docs.databricks.com/api/azure/account/accountgroups/patch) as mentioned in this link I could able to authenticate but not able to add member while using below body. Could please someone guide what i missed to add in body?
{"schemas": [
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"Operations":[
{
"op": "add",
"path": "/members",
"value": "xyz@abcdcomapny.com"
}
]
}
05-06-2024 05:22 AM
Hi @Retired_mod
I have tried suggest body also but still member is not added to group. is there any other method that i can use add member to the group at account level
Thanks,
Phani.
07-09-2024 06:26 AM
@Retired_mod I am having the same issue as @pragarwal : after sending the api request and getting success code 200 the member is not added to the admin group.
07-23-2024 06:36 PM - edited 07-23-2024 07:40 PM
I am working on workspace-local group APIs on Azure Databricks though what @Retired_mod suggested did not work to me too. I checked the payload sent from Databricks workspace frontend and the following worked to me. Has API signature been changed but document hasn't been updated?
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"Operations": [
{
"op": "add",
"value": {
"members": [
{
"value": "0000000000000000 (replace this with your Databricks USER ID)"
}
]
}
}
]
}
Edit:
I am using PATCH `/api/2.0/preview/scim/v2/Groups/{id}` API. I found another doc which looks like v2.1 API reference and the signature looks quite similar to what I used.
Account SCIM 2.1 Documentation (databricks.com)
07-27-2024 01:05 PM - edited 07-27-2024 06:08 PM
Looks like value should be an array. This worked to me to add three users to a group. Replace xxx/yyy/zzz with account ID.
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"Operations": [
{
"path": "members",
"op": "add",
"value": [
{
"value": "xxx"
},
{
"value": "yyy"
},
{
"value": "zzz"
}
]
}
]
}
On the other hand, remove operation seems a bit different format. Add remove operation for each entry to remove. Here is an example to remove three users with ID xxx, yyy and zzz from a group.
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"Operations": [
{
"op": "remove",
"path": "members[value eq \"xxx\"]"
},
{
"op": "remove",
"path": "members[value eq \"yyy\"]"
},
{
"op": "remove",
"path": "members[value eq \"zzz\"]"
}
]
}
09-06-2024 02:47 PM - edited 09-06-2024 02:51 PM
Does the above work? I still can't quite figure it out. Any help would be much appreciated.
I know authentication is not an issue as I can use a lot of the other endpoints. I just can't figure out the correct body syntax to add a member to a group.
url= https://accounts.azuredatabricks.net/api/2.0/accounts/<account_id>/scim/v2/Groups/<group_id>
data= {
'schemas': [
'urn:ietf:params:scim:api:messages:2.0:PatchOp'
],
'Operations': [
{
'op': 'add',
'path': '/members',
'value': {
'value': '<user>@<domain>.com'
}
}
]
}
header={'Content-Type': 'Authorization': 'Bearer <token>'}
My code is
09-23-2024 03:02 PM
This payload worked for me:
URL: https://{databricks_instance}/api/2.0/account/scim/v2/Groups/{group_id}
PATCH with this payload
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.
If there isn’t a group near you, start one and help create a community that brings people together.
Request a New Group