Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Connecting to Powerbi Metatdata hosted in Azure Analysis Services through python

I am trying to query my powerbi metadata stored in Azure Analysis services through python.

I have used Nuget package and loaded the dll "Microsoft.AnalysisServices.AdomdClient" to my root folder (RHEL Linux), when I tried to execute the below program it throws an error (screenshot attached below)

from sys import path
path.append('/root/dll/Microsoft.AnalysisServices.AdomdClient')
from pyadomd import Pyadomd
conn='Provider=MSOLAP.7;Data Source=powerbi://api.powerbi.com/v1.0/myorg/;Initial Catalog=model;User Id=testuser;Password=;'
query = "SELECT DIMENSION_CAPTION AS [DIMENSION] FROM $system.MDSchema_Dimensions"

with Pyadomd(conn) as conn:
    with conn.cursor().execute(query) as cur:
        print(cur.fetchall())

 

2 Replies