0

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))
Raja
  • 513
  • 5
  • 18
  • You can refer to [Connect to Azure analysis services from python](https://stackoverflow.com/questions/50784236/connect-to-azure-analysis-services-from-python) and [answer by Parfait](https://stackoverflow.com/a/33727190/15969115) – Ecstasy Aug 06 '21 at 11:08
  • Did this with MSAL by acquiring Token and passing only the token as the `password` Slighty differnet usecase though – Supun De Silva Jul 20 '22 at 03:08

0 Answers0