Extension.CurrentCredential

Updated on

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

Learn more about Extension.CurrentCredential in the following articles:

Other functions related to Extension.CurrentCredential are:

Contribute » | Contributors: Rick de Groot

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy