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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Variations of the same data source API are treated as different data sources (credentials & privacy)

I have created a custom connector for a specific REST API, and I am able to invoke the different services of the API from Power BI Desktop queries using the custom connector. The services of the API require authorization, and technically everything works using the Basic option for the credentials, and the Organizational privacy level, which are all stored in Power BI Desktop. Technically everything works.


However, it is extremely inconvenient that when I create a single query, calling the API, and run the query for the first time, Power BI Desktop prompts me multiple times for the credentials and privacy levels. In my query, even though I am making multiple calls to the API, I am only using the one overall API through the one custom connector, and thus I only need the one credentials and the one privacy level. It is very tedious to input the same credentials and privacy levels a dozen times for just a single query. After the initial bombardment of prompts is over and the credentials and privacy levels are stored inside Power BI Desktop, everything works fine from that point on, until the stored permissions are cleared.


What I suspect is happening, is that when I make different calls to the API (thus changing the end part of the URL of the Web.Contents() call inside the custom connector), Power BI Desktop is treating every single variation of the API as a new distinct data source, and thus reprompts for the credentials and privacy levels for each variation. When I check the Data Source Settings, I see a long list of stored permissions for "different" data sources, which all are named identically after the same custom connector.


Is it possible to tell Power BI Desktop to use the same credentials and privacy levels for all variations of the same base API URL?


P.S. I'm not sure if this is relevant or not, but inside the custom connector, I'm using a randomized dummy URL parameter at the end of the login service URL path, because otherwise Power BI Desktop seemed to use cached (expired) authorization tokens instead of recalling the login service. However, I don't believe this should affect my issue stated above, because the login function of the custom connector uses the same credentials from Extension.CurrentCredential(), and should work fine as the credentials don't need to be changed.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I found a workaround/solution for my problem. Looking at the official documentation I found out that "the M engine identifies a data source based on the required parameters of the custom connector". I changed my custom connector so that only the common part of the API URL is regarded as a required parameter and the other parameters (including the end part of the URL) are regarded as optional. This way Power BI stores credentials for the data source based on the common part of the API URL and uses those credentials for all calls to the API with the same common part of the URL.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

I found a workaround/solution for my problem. Looking at the official documentation I found out that "the M engine identifies a data source based on the required parameters of the custom connector". I changed my custom connector so that only the common part of the API URL is regarded as a required parameter and the other parameters (including the end part of the URL) are regarded as optional. This way Power BI stores credentials for the data source based on the common part of the API URL and uses those credentials for all calls to the API with the same common part of the URL.

Thank you for sharing your solution

v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

After researching, I don't find that someone has the same issue. Maybe it is caused by the URL or the custom connector. Suggest you to create a support ticket to get a dedicated support. You could provide the files to the engineers. It is a safe and quick way.

Support Ticket.gif

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi, thanks for the reply!

 

Unfortunately I am not a Pro user (and I am currently not in a position where I can become a Pro user), and thus I am unable to create support tickets. I will keep looking into this issue, any further tips are greatly appreciated.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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