Connect to Azure sql in Python Using Service Principal

746 Views Asked by At

I have a Service principal with a client id and client secret. It has permission to the Azure SQL DB. I want to use python to generate an access token and use it to authenticate to my sql server. Could someone guide me.

I am new with python and would appreciate if someone could specify if I need any supporting libraries for this to work.

1

There are 1 best solutions below

0
Utkarsh Pal On

I want to use python to generate an access token.

The Azure Active Directory Authentication library for python can be used to access SQL Server in Azure.

Refer this GitHub repository to know more details and how to implement the same.