Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Can I use "mssql-scripter' to connect to power bi to programmatically generate "Script Database as" output for power bi models.
if "mssql-scripter' won't work with analysis services database, then please suggect a solution to programaticall generate the database xmla script from power bi service using python
I tried the following code in python
from mssqlscripter import main
args = ['-S', 'powerbi://api.powerbi.com/v1.0/myorg/WS_NAME ', '-d', 'XXX', '-U', 'XXX', '-P', 'XXX']
result = main.main(args)
print(result)
But it throws
Failed to connect to server powerbi://api.powerbi.com/v1.0/myorg/WS_NAME
Hi @SriThiru
You can connect to an XMLA endpoint for a Dataset, if that Dataset is stored on a "Premium Capacity" or "Premium Per User" workspace. In this case it's possible that the workspace with the Dataset you're trying to connect to is not one of those.
See : Dataset connectivity and management with the XMLA endpoint in Power BI - Power BI | Microsoft Docs
Hope this helps
Stuart
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
56 | |
27 | |
23 | |
21 | |
19 |
User | Count |
---|---|
51 | |
24 | |
20 | |
20 | |
17 |