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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
Super User
Super User

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors