Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.
I was trying to create a custom data source which is wrapper on top of SQL.
I have set the Username-Password credentials for the custom data source. But it reports an error of missing credentials while attempting to connect the Sql database.
{
...
"Method": "PQTest.RunTest",
"Name": "ms_test_ext.query.pq",
"Status": "Failed",
"Type": "PQTest.Expression",
"Error": {
"Message": "Credentials are required to connect to the ms_test_ext source. (Source: from myserver-ondemand.sql.azuresynapse.net;db to ms_test_ext.)",
"Details": {
"Microsoft.Data.Mashup.CredentialError.Reason": "CredentialMissing",
"Microsoft.Data.Mashup.CredentialError.DataSourceKind": "ms_test_ext",
"Microsoft.Data.Mashup.CredentialError.DataSourcePath": "ms_test_ext",
"Microsoft.Data.Mashup.CredentialError.DataSourceOriginKind": "SQL",
"Microsoft.Data.Mashup.CredentialError.DataSourceOriginPath": "myserver-ondemand.sql.azuresynapse.net;db",
"Microsoft.Data.Mashup.MashupSecurityException.Reason": "CredentialMissing",
"Microsoft.Data.Mashup.MashupSecurityException.DataSources": "[{\"kind\":\"ms_test_ext\",\"path\":\"ms_test_ext\"}]"
}}}
While if I directly try to use this query in test file it works fine.
Hi ms_query,
We are following up to see if your query has been resolved. Should you have identified a solution, we kindly request you to share it with the community to assist others facing similar issues.
If our response was helpful, please mark it as the accepted solution and provide kudos, as this helps the broader community.
Thank you.
Hi ms_query,
We wanted to check in regarding your query, as we have not heard back from you. If you have resolved the issue, sharing the solution with the community would be greatly appreciated and could help others encountering similar challenges.
If you found our response useful, kindly mark it as the accepted solution and provide kudos to guide other members.
Thank you.
Hi ms_query,
We would like to inquire if the solution offered by @SacheeTh and @lbendlin has resolved your issue. If you have discovered an alternative approach, we encourage you to share it with the community to assist others facing similar challenges.
Should you find the response helpful, please mark it as the accepted solution and add kudos. This recognition benefits other members seeking solutions to related queries.
Thank you.
If @ms_query ,
If you want to limit some access based on each user, you can use RLS and OLS for this as @lbendlin suggested.
Initally connect using the standard connection using the SQL user name password. Then setup the Ro level Security and share with users accordingly.
You even can use the Object level Security filtering some part of the tables with specific user group.
If you have a larger yser list, you may bring the same users to the model and setup a dynamic RLS where each user filers the specific rows accordingly
What's the reason for bolting this onto a standard SQL connection?
@lbendlin Thanks for the reply, I need to create a wrapper on top of the SQL connection which would filter data based on some bussiness need before user's data access.
That's what RLS is for?
Yes it is, but more specific.
The need is to restrict at the data-source integration level. Bcause the entitlement configurations are not exposed to the dashboard developer.
Thanks @SacheeTh for the reply.
Yes I have Authentication setup in my extension as you suggested. But it fails while evaluteing ms_test_ext.query.pq itself.
as if it could not find the credentials for
Tyr Modify your as follow, pass both the server and databas
let
result = ms_test_ext.Contents("myserver-ondemand.sql.azuresynapse.net", "mydatabase")
in
result
Not much of an indea since your one is a custom connector, asuming this is done using power m query, I can suggest following as well,
Ensure the DataSourcePath matches what the SQL source (myserver-ondemand.sql.azuresynapse.net) expects. This includes both the server name and the database name.
The CredentialMissing error often happens when the SQL credentials are not propagated correctly from the custom connector.
You're passing only the server URL, but SQL often requires both server and database names explicitly. Adjust the connector to expect both parameters.
Is it possible for you to try with any of your SQL server connection to confirm. As nothing is working for me.
The CredentialMissing error in your Power BI custom connector indicates that the credentials for the custom data source (ms_test_ext) are not being properly supplied or recognized. This can occur even if the test file works fine because Power BI Desktop and the testing environment handle credentials differently.
Here are steps to troubleshoot and resolve the issue:
1. Check Credential Storage in Power BI
Ensure that the credentials are set up correctly in Power BI for your custom data source.
Open Power BI Desktop.
Navigate to File > Options and Settings > Data Source Settings.
Locate your custom data source (ms_test_ext).
Edit the credentials to ensure the Username-Password combination is properly entered.
On 2nd thought, Looking at the code snippet in your screenshot, the issue might be related to how credentials are handled in your custom connector. Below are the adjustments and steps to ensure credentials are correctly passed and recognized by your custom data source (ms_test_ext).
Add an Authentication property in the DataSource.Kind configuration to specify UsernamePassword authentication. This tells Power BI how to handle credentials for your custom connector.
[DataSource.Kind = "ms_test_ext", Publish = "ms_test_ext.Publish"]
shared ms_test_ext.Contents = (url as text) =>
let
Source = Sql.Databases(url),
db = Source{[Name = "db"]}[Data]
in
db;
ms_test_ext = [
Authentication = [
UsernamePassword = []
],
Label = "Custom SQL Data Source"
];
Authentication Property:
Simplified Parameter Handling:
Label Property:
After implementing the updated code:
Before deploying the connector, test it using the Power Query SDK to ensure it correctly requests and uses the credentials.
Ensure no conflicting or cached credentials exist:
If deploying to Power BI Service:
If you still encounter issues, provide the detailed error logs or let me know, and I can assist further!
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.