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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
nvijay
Frequent Visitor

Extension.CurrentCredential wasn't recognized - ERROR while Getting User Credentials in Power Query

Hi

 

Inspite of being mentioned on Microsoft website (Handling authentication for Power Query connectors - Power Query | Microsoft Learn) that User credentials can be fetched using Extension.CurrentCredential. Still getting this error

Expression.Error: The name 'Extension.CurrentCredential' wasn't recognized. Make sure it's spelled correctly.

 

Can you please advise whats the cause for this discrepancy ?

My use case is: I need to fetch the User Credentials within Power BI

4 REPLIES 4
clongaw
Frequent Visitor

I cannot speak to all the circumstances, but from experience I have been able to use Extension.CurrentCredential() for global variable declaration in a local Custom Connector not verified or published by Microsoft. This case should prompt the user for entering a username and password before running the DataSource.Kind function with it's parameters. However, I have had difficulty in using Extension.CurrentCredential() in function definitions such as RefreshLogin for OAuth flow.

username = Extension.CurrentCredential()[Username];
password = Extension.CurrentCredential()[Password];

 

v-yanjiang-msft
Community Support
Community Support

Hi @nvijay ,

Has your problem beed solved? If so, please kindly accept the helpful reply as solution, then we'll close the thread, other people who has the similar problem will benefit from here. Thank you!

 

Best regards,

Community Support Team_yanjiang

v-yanjiang-msft
Community Support
Community Support

Hi @nvijay ,

One possible cause is that you are using the Extension.CurrentCredential function in a custom connector that is not published or certified by Microsoft. According to the document, this function is only available for published or certified connectors, and not for local connectors. If you are developing a custom connector, you may need to use other methods to handle authentication, such as OAuth or Key.

Another possible cause is that you are using the Extension.CurrentCredential function in a wrong context or scope. According to this blog, this function can only be used in the Data Source Kind definition, and not in the Data Source UI definition or the Data Source Functions. If you are using it in a wrong place, you may get an error like the one you mentioned.

A possible solution is to check your code and make sure that you are using the Extension.CurrentCredential function correctly and in the right place. You can also refer to some examples of how to use this function in different scenarios, such as this one.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

rubayatyasmin
Community Champion
Community Champion

Hi, @nvijay 

 

I found a similar thread, it might be helpful. Go through the thread. 

 

https://community.fabric.microsoft.com/t5/Power-Query/Get-OAuth-Custom-Connector-to-check-for-valid-...

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.