I have a notebook that I am able to run in itself, but when I run it within a Databricks job, it fails with the following error:
[UNAUTHORIZED_ACCESS] PERMISSION_DENIED: User does not have MANAGE on Connection 'dev_postgres'. SQLSTATE: 42501
The notebook uses a connection to az Azure hosted Posgresql database for writing logs and reading metadata. My user had ALL PRIVILEGES privilege on this connection, but this was not enough. When I got MANAGE privilege, the job ran successfully.
I can't find a reason why this MANAGE privilege is needed in order to be able to run the notebook in a job. MANAGE privilege is used to grant and revoke privileges for other users. Does this mean that there is another user that runs the task behind the hood when I run it within a job? Or what other explanations are there? Is there another way to run the job besides giving MANAGE privilege to the user for the connection?