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

Not able to use User ID and Password when using connection string of Azure analysis server #22

Open kalpeshparakh opened 1 year ago

kalpeshparakh commented 1 year ago

When trying to use this library in Python application, the library is ignoring the credentials passed in the connection string. It again prompts with SSO screen for consent.

connection_string = "Provider=MSOLAP;Data Source=asazure://someas_url/someserver;Catalog=gfhfghtr;User ID=####;Password=####"

with Pyadomd(connection_string) as conn: with conn.cursor().execute(generated_dax_query) as result: df = pd.DataFrame.from_records(result.fetchone()) df.columns = [i.name for i in result.description] tableresponse = st.table(df)

When using above connection string the system still prompts me to login, the library is not using the user id and password supplied to it. sso

Please help to get it resolved, or to identify any additional steps missing

Thanks for your help

NickSandelRWH commented 11 months ago

Have you tried using a service principal user instead? The query string needs to be User ID=app:{APP_ID}@{TENANT_ID};Password={APP_SECRET} I have gotten this working fine but I haven't tried a normal user, I suspect it might be something to do with MFA being on for that user meaning you can't use it in this manner.

Sorry just to add my example is connecting to the powerbi api: powerbi://api.powerbi.com/v1.0/myorg/ and I think I do have this working for a user with MFA turned on so maybe it's an analysis server difference?

CrasCris commented 1 month ago

Have you tried using a service principal user instead? The query string needs to be User ID=app:{APP_ID}@{TENANT_ID};Password={APP_SECRET} I have gotten this working fine but I haven't tried a normal user, I suspect it might be something to do with MFA being on for that user meaning you can't use it in this manner.

Sorry just to add my example is connecting to the powerbi api: powerbi://api.powerbi.com/v1.0/myorg/ and I think I do have this working for a user with MFA turned on so maybe it's an analysis server difference?

Can you showme and example plss ?, you are using the powerbi connection string right ?