Extension.CurrentCredential is a Power Query M function that retrieves the current credential record for the data source, with an optional refresh option.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
Extension.CurrentCredential( optional forceRefresh as nullable logical ) as nullable record
Examples
Here’s an example that uses Extension.CurrentCredential for handling the current credential for an API key, and uses it to populate the x-APIKey
custom header:
MyConnector.Raw = (_url as text) as binary =>
let
apiKey = Extension.CurrentCredential()[Key],
headers = [
#"x-APIKey" = apiKey,
Accept = "application/vnd.api+json",
#"Content-Type" = "application/json"
],
request = Web.Contents(_url, [ Headers = headers, ManualCredentials = true ])
in
request
Related articles
Learn more about Extension.CurrentCredential in the following articles:
- Handling authentication
The articles delves into different authentication types for custom connectors in Power Query M. » Read more
Related functions
Other functions related to Extension.CurrentCredential are:
- Extension.Cache
- Extension.Contents
- Extension.CredentialError
- Extension.CurrentApplication
- Extension.HasPermission
- Extension.InvokeVolatileFunction
- Extension.InvokeWithCredentials
- Extension.InvokeWithPermissions
- Extension.LoadString
- Extension.Module
- Extension.State
2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy