S-C-O-U-T / Pyadomd

A pythonic approach to query SSAS data models.
https://pyadomd.readthedocs.io/en/latest/index.html
Apache License 2.0
25 stars 6 forks source link

Error: the specified workspace is not found #25

Open patjones80 opened 1 year ago

patjones80 commented 1 year ago

Hi there. We are currently using pyadomd to build out a test script in Windows 10, and are receiving the following traceback upon execution:

  File "c:\Users\yuzhang\Documents\pbi-XMLA\python\pbi-XMLA.py", line 40, in <module>
    with pyadomd.Pyadomd(connection_string) as conn:
  File "C:\Users\yuzhang\AppData\Local\Programs\Python\Python310\lib\site-packages\pyadomd\pyadomd.py", line 158, in __enter__
    self.open()
  File "C:\Users\yuzhang\AppData\Local\Programs\Python\Python310\lib\site-packages\pyadomd\pyadomd.py", line 140, in open
    self.conn.Open()
  Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException: The specified Power BI workspace is not found.

Our code:

from sys import path
path.append(r'C:\Program Files\Microsoft.NET\ADOMD.NET\160')
import pyadomd

url = r'powerbi://api.powerbi.com/v1.0/myorg/UAT'
connection_string = f"Provider=MSOLAP;Data Source={url};\
                                    Initial Catalog=Active_Lgl_Decom-Tree;Persist Security Info=True;\
                                    Impersonation Level=Impersonate;\
                                    Encrypt=False;\
                                    User ID=app{APPLICATION_ID}@{TENANT_ID};Password={SECRET_TOKEN};"
query = """select 
               [CATALOG_NAME] as DatabaseName,
               [SIZE] as Size
           from
               $SYSTEM.DBSCHEMA_CATALOGS"""

with pyadomd.Pyadomd(connection_string) as conn:
    with conn.cursor() as cursor:
        cursor.execute(query)
        for row in cursor:
            print(row)

We're sure that our URL is correct as we copied it directly from the workspace's settings in the Power BI interface. While we have reached out to Microsoft, we also wanted to check here as well to see if there are any known issues. Thank you!

@brianzy

CrasCris commented 3 months ago

Hi there. We are currently using pyadomd to build out a test script in Windows 10, and are receiving the following traceback upon execution:

  File "c:\Users\yuzhang\Documents\pbi-XMLA\python\pbi-XMLA.py", line 40, in <module>
    with pyadomd.Pyadomd(connection_string) as conn:
  File "C:\Users\yuzhang\AppData\Local\Programs\Python\Python310\lib\site-packages\pyadomd\pyadomd.py", line 158, in __enter__
    self.open()
  File "C:\Users\yuzhang\AppData\Local\Programs\Python\Python310\lib\site-packages\pyadomd\pyadomd.py", line 140, in open
    self.conn.Open()
  Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException: The specified Power BI workspace is not found.

Our code:

from sys import path
path.append(r'C:\Program Files\Microsoft.NET\ADOMD.NET\160')
import pyadomd

url = r'powerbi://api.powerbi.com/v1.0/myorg/UAT'
connection_string = f"Provider=MSOLAP;Data Source={url};\
                                    Initial Catalog=Active_Lgl_Decom-Tree;Persist Security Info=True;\
                                    Impersonation Level=Impersonate;\
                                    Encrypt=False;\
                                    User ID=app{APPLICATION_ID}@{TENANT_ID};Password={SECRET_TOKEN};"
query = """select 
               [CATALOG_NAME] as DatabaseName,
               [SIZE] as Size
           from
               $SYSTEM.DBSCHEMA_CATALOGS"""

with pyadomd.Pyadomd(connection_string) as conn:
    with conn.cursor() as cursor:
        cursor.execute(query)
        for row in cursor:
            print(row)

We're sure that our URL is correct as we copied it directly from the workspace's settings in the Power BI interface. While we have reached out to Microsoft, we also wanted to check here as well to see if there are any known issues. Thank you!

@brianzy

Did you find the solution ?