Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext 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
I am retrieving an access token by calling an API and then use this access token to obtain employee data. I'm using a blank query with the following code.
body="grant_type=client_credentials&client_id="&<client_id>&"client_secret="&<client_secret>,
Source = Json.Document(Web.Contents(baseUrl,
[
RelativePath = "oauth/issueToken",
Headers = [#"Content-Type"="application/x-www-form-urlencoded"],
Content=Text.ToBinary(body)
]
)),
token = Source[access_token],
data= Json.Document(Web.Contents(baseUrl,
[
RelativePath = "api/employees",
Headers = [#"Authorization"="Bearer "&token]
]
)),
I'm getting access token calling our own API (not using AAD). What is the best way to store these client credentials (client_id and client_secret) instead of hardcoding in the code?
Besides the great option @lbendlin mentioned, with an additional API endpoint you could also use the builtin credentials manager https://community.powerbi.com/t5/Power-Query/How-to-securely-store-and-use-token-and-secret-for-API-...
store them in a text file in a sharepoint document library that only you have access to. Then retrieve that file as part of the Power Query transforms etc.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 4 | |
| 3 | |
| 2 |