Forum Discussion
Mahee
1 year agoRegular Visitor
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 D...
- 1 year ago
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
SourceThen 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. ✅
HarishKM
1 year agoSuper User
Mahee Hey,
Try below method
Azure SQL requires your client IP to be whitelisted in the Azure SQL server firewall settings.
Even if credentials are correct, connection will fail if IP is not allowed.
Double-check that the machine running Power BI Desktop or the gateway is allowed through firewall rules.
Thanks
Harish M
Please accept this as a solution if this solves your problem and give kudos as well.