【发布时间】:2021-11-25 08:30:35
【问题描述】:
我设法使用以下代码 sn-p 从 python 连接到 Databricks:
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()
这个sn-p来自官方documentation,如你所见,它需要server_hostname、http_path和access_token。我的问题是,我可以在没有access_token 的情况下验证自己的身份吗?也许使用托管标识,因为这两种技术都来自 Microsoft?
【问题讨论】:
标签: python azure-databricks azure-managed-identity databricks-sql