I managed to connect to Databricks from python using the following code snippet:
from databricks import sql
connection = sql.connect(
server_hostname='<server-hostname>',
http_path='<http-path>',
access_token='<personal-access-token>')
cursor = connection.cursor()
cursor.execute('SELECT * FROM <database-name>.<table-name> LIMIT 2')
result = cursor.fetchall()
for row in result:
print(row)
cursor.close()
This snippet is from the official documentation and as you can see, it requires server_hostname
, http_path
and access_token
. My question here is, can I authenticate myself without the access_token
? Maybe use a managed identity, since both technologies are from Microsoft?