I am trying to connect to Azure Analysis Service in Python using adodbapi. Using Application Service Principal.
While I am able to connect and execute with my personal credentials, thru multi factor authentication. But, i am struck on how to establish connection thru Service Principal using adodbapi
Below code is for reference which i am trying after reading few articles. But, nothing working out.
Can someone pls help ??
from azure.identity import ClientSecretCredential
import adodbapi as aasapi
def main(mytimer: func.TimerRequest) -> None:
# Retrieve the IDs and secret to use with ServicePrincipalCredentials
subscription_id = "xxxxx"
tenant = "xxxx"
client = "xxxx"
client_sec = "xxxx"
credential = ClientSecretCredential(tenant_id=tenant, client_id=client, client_secret=client_sec)
aasConn = aasapi.connect("Provider=MSOLAP;Data Source=asazure://<xxxx>.asazure.windows.net/<server>;Catalog=<TabularDatabase>;UID=;PWD={0}".format(credential))