cancel
Showing results for 
Search instead for 
Did you mean: 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results for 
Search instead for 
Did you mean: 

Databricks grant update calatog catlog_name --json @privileges.json not updating privileges

Prasad_Koneru
New Contributor III

Hi Team,

 

I am trying to update the catalog permission privileges using databricks cli command Grant by appending json file but which is not updating the prIviliges, please help on grant update command usage.

Command using :  databricks grants update catalog demo_cat --json @privileges.json 

which is listing old prIviliges only, not updating i have updated from ALL_PRIVILEGES to USE_CATALOG

privileges.json content:

{
"privilege_assignments": [
{
"principal":"mailid",
"privileges": [
"USE_CATALOG"
]
}
]
}

 

2 REPLIES 2

Ravivarma
Databricks Employee
Databricks Employee

Hello @Prasad_Koneru 

 If the command is not updating the privileges as expected, there could be a few reasons for this. 

Firstly, ensure that the JSON file is correctly formatted and contains the correct privilege assignments. The privileges.json file should look something like this:

 

{
  "privilege_assignments": [
    {
      "principal": "principal_name",
      "privileges": [
        "USE_CATALOG"
      ]
    }
  ]
}
 

Replace "principal_name" with the actual principal (user or group) to which you want to grant the privilege.

Secondly, make sure that you have the necessary permissions to update the privileges. If you don't have the required permissions, the command might not execute as expected.

Lastly, there could be an issue with the Databricks CLI itself. Ensure that you're using the latest version of the CLI and that it's correctly configured.

sabrina_s
New Contributor II

Hi, 

I am having a similar issue when trying to update grants for my external location and trying to grant all privileges to "ml" service principal. 

Running on Windows with version Databricks CLI v0.223.1

This is the command I'm running in the CLI

databricks grants update external-location mdct_bronze --json @"filepath\privileges.json"

This is what the privileges.json file looks like 

{
  "privilege_assignments": [
    {
      "principal": "ml",
      "privileges": [
        "ALL_PRIVILEGES"
      ]
    }
  ]
}

The only output I'm receiving when running the command is 

{}

However, when I update the privileges from the UI and run 

databricks grants get external-location mdct_bronze --principal ml

 I receive the following output

{
  "privilege_assignments": [
    {
      "principal":"ml",
      "privileges": [
        "ALL_PRIVILEGES"
      ]
    }
  ]
}

 Is there something wrong with the json configuration? 

Connect with Databricks Users in Your Area

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