cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Administration & Architecture
Explore discussions on Databricks administration, deployment strategies, and architectural best practices. Connect with administrators and architects to optimize your Databricks environment for performance, scalability, and security.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Databricks Workflow/Jobs View Log Permission

VCHK
New Contributor

If we don't want to expose admin right to user group. What should we do to allow a specific user group to have permission to view all of the job logs in a Databricks account? 

We don't want to grant job level permission too.

Thanks,

VC

1 REPLY 1

SathyaSDE
New Contributor III

Hi, I guess you can use Databricks API to list jobs and set Can view permission to all jobs.

Sample code below:

 

import requests
from databricks_cli.sdk import ApiClient, JobsService, PermissionsService

# Initialize the API client
api_client = ApiClient(
    host="https://<databricks-instance>",
    token="<personal-access-token>"
)

# List all jobs
jobs_service = JobsService(api_client)
jobs_list = jobs_service.list_jobs()

# Set 'CAN_VIEW' permission to all jobs
permissions_service = PermissionsService(api_client)
for job in jobs_list['jobs']:
    job_id = job['job_id']
    permissions_service.update_job_permissions(
        job_id,
        {
            "access_control_list": [
                {
                    "user_name": "<user-email>",
                    "permission_level": "CAN_VIEW"
                }
            ]
        }
    )

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