The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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
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];
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
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.
Hi, @nvijay
I found a similar thread, it might be helpful. Go through the thread.
Proud to be a Super User!