Forum Discussion
Can we connect to Power BI's datamart using Python?
- 1 year ago
Hi OmarE,
Thank you for your response.
Please find below the key points when connecting Python to Power BI Datamarts, which may help in resolving the issue:
- SQL authentication (UID/PWD) is not supported for Power BI Datamarts.
- Users with Multi-Factor Authentication (MFA) must use Authentication=ActiveDirectoryInteractive, which will trigger a login pop-up for authentication.
- For users who do not have MFA enabled, Authentication=ActiveDirectoryPassword can be used. However, this method is only applicable if the organisation does not enforce MFA.
If you find our response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar queries.
Thank you.
Thank you for the guidance. I connected Python to the datamart using "Authentication=ActiveDirectoryInteractive;" in the conn_str variable provided by GilbertQ , which triggered a pop-up login where I could enter my email, password, and OTP code to authenticate. However, I couldn't get it to work by specifying only the username (e.g."UID=your_username;") and password ("PWD=your_password") as in the sample code. From my research, it seems that UID/PWD should correspond to SQL database credentials. Can you confirm if that's still the case for Power BI Datamarts, or is there a way to authenticate using my own user credentials (even if my organization uses multi-factor authentication)?