Forum Discussion

Mahee's avatar
Mahee
Regular Visitor
1 year ago
Solved

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...
  • anilelmastasi's avatar
    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
    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.