Can job 'run_as' be assigned to users/principals who actually run it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 02:47 AM
Can job 'run_as' be assigned to users/principals who actually run it? instead of always a fixed creator/user/pricipal?
When a job is run, I would like to see in the job setting "run_as" the name of the actual user/principal who runs it.
Currently, "run_as" is set to a fixed user/principal. If someone else runs this job (either manually or using APIs), "run_as" is still showed as the fixed user/principal, and not the actual user/principal who runs it.
Am I missing something or this feature is actually not available?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 03:24 PM
This is not avaliable in Workflow/Jobs.
Job should newer be run as person who is executing the job, especialy in Production.
The reason is that the output might be not the same, base on person who is running the job (e.g. diffrent Row Level Access).
If you must use Workflows, you could give people "Manage" permission over job and let them change run as every time (but that is ugly solution).
What you are looking for is something diffrent:
- give person ability to run notebook / package using all-purpose cluster
- if you want to do it via job and job cluster - let people use JOB API "/api/2.1/jobs/run-now"
https://docs.databricks.com/api/azure/workspace/jobs/runnow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Yeah, the functionality is odd. You can't change the Run As user to anyone but yourself.
But you can run it using the Run As setting previously used. This sort of makes sense if the workflow is created to be run as a service principal with specific permissions, if everyone was going to run it as that user. But it doesn't make sense that you can run it as the previous person if that person had changed the Run As to themselves.

