Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join 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.

Reply
Mahee
New Member

Power BI to Azure SQL MI Connection via Power Query Parameters

Hi All,

 

Good Day!

We have a Power Query parameter for Server (Azure SQL MI) and Database. Once we create and try to save it with credentials, It is throwing an error. But the same server and Database can be accessed via SSMS with the same username/pwd.

I am just trying to understand is there any limitation in Power BI for this scenario when connecting to Azure SQL MI via parameters. Pls be noted that the same scnaio is working when we trying to connect with onpremise server.

Kindly advise.

Thanks!

2 REPLIES 2
rohit1991
Super User
Super User

Hi @Mahee ,
Power BI does not support dynamic parameters for server or database names when connecting to Azure SQL Managed Instance with credentials. This limitation causes errors, even if SSMS works.

Workaround:
Use fixed (static) values for the server and database in Power Query. If you need to change them, update the parameter in Power BI Desktop, then republish and re-enter credentials.
More info: Microsoft Docs - Parameterize Connection Variables (Limitations)


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
anilelmastasi
Solution Supplier
Solution Supplier

Hello @Mahee ,

 

Power BI does not allow credentials to be saved for dynamic data source references (i.e., server/database coming from parameters), unless you're using an on-prem gateway. This is why it works for on-prem SQL (via Gateway) but not for Azure SQL MI without one.
 
When you use Power Query parameters directly in your SQL Server connector like this:
Sql.Database(ServerParam, DatabaseParam)

 
Power BI considers this a "dynamic data source", and dynamic data sources prevent credential storage or scheduled refresh in many cases.

Limitation: Power BI cannot associate credentials with a dynamic value for server/database unless it's marked as a gateway allowed data source with fixed metadata.
 
To avoid dynamic binding issues:
Instead of:
Sql.Database(ServerParam, DatabaseParam)
 
Use:
let
Source = Sql.Database("your-server.database.windows.net", "your-db-name")
in
Source
 
Then use parameters only within queries (e.g., for schema/table filtering), not for the source connection string.

 If this solved your issue, please mark it as the accepted solution.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.