Forum Discussion
Failed to update data source credentials: The credentials provided for the OData source are invalid.
The error was exactly what I first posted in the beginning of this post. I already aligned the credentials between PBI desktop & PBI service since the beginning I created this post.
| Processing error: | The credentials provided for the OData source are invalid. (Source at https://graph.microsoft.com/v1.0/planner/plans/_pmTMWQX8U2g4M3iG3bVVckAC2OE.) |
| Cluster URI: | WABI-SOUTH-EAST-ASIA-B-PRIMARY-redirect.analysis.windows.net |
| Activity ID: | ec513eba-0262-4b2e-a333-75581081d1dd |
| Request ID: | 97e8c9a2-f52f-a4a7-832a-efbb6825358a |
| Time: | 2023-03-08 02:35:50Z |
- ChristianEvan333 years agoFrequent Visitor
Hi AlinaYakymchuk,
Sorry for the late reply. Actually now still no significant progress. I discussed with my company's IT team that handles office apps and they already contact directly to the Microsoft Engineers.
The engineers provided a solution to directly embed the credentials in Power Query's M-code. This might also be possible to create a parameter so that changing the credentials will be much easier in the future.My issue with this solution is that actually my company blocks direct authentication from the PBI Service to the planner. It requires microsoft authenticator with two-factor authentication.
I do not know with the condition of your company but you can try using this solution for your side.
But I think you need to talk with your IT team to help on this too since there might be a lot of things to work on together.
let
token_uri = https://login.microsoftonline.com/ & "your tenant id" & "/oauth2/v2.0/token",
scope= https://graph.microsoft.com/.default,
tokenResponse = Json.Document(Web.Contents(token_uri,
[
Content = Text.ToBinary(Uri.BuildQueryString(
[
client_id = "your application id",
scope = scope,
grant_type = "client_credentials",
client_secret = "your application secret"
]
)),
Headers = [Accept = "application/json"], ManualStatusHandling = {400}
])),
access_token = tokenResponse[access_token],
Source = OData.Feed(https://graph.microsoft.com/v1.0/planner/plans/1-Kv1mpx60WDf1gghCycyAgAHVRt, [ Authorization = "Bearer " & access_token ], [ExcludedFromCacheKey={"Authorization"}, ODataVersion=4, Implementation="2.0"]),
#"Converted to Table" = Record.ToTable(Source)
in
#"Converted to Table"
----------------------------------------------------------------------------------------------------------
Or you can register another App as below (add Delegated permissions) and update the Power Query(replace highlighted content), to check if you can only get data from the plan which the account has permission to access.
let
token_uri = https://login.microsoftonline.com/ & "your tenant id" & "/oauth2/v2.0/token",
scope= https://graph.microsoft.com/.default,
tokenResponse = Json.Document(Web.Contents(token_uri,
[
Content = Text.ToBinary(Uri.BuildQueryString(
[
client_id = "your application id",
scope = scope,
grant_type = "password",
username = “your user account”
password = "your account password",
client_secret = " your application secret "
]
)),
Headers = [Accept="application/json"]
])),
access_token = tokenResponse[access_token],
Source = OData.Feed(“https://graph.microsoft.com/v1.0/planner/plans/MQ3EoFzvz0OblZ3MNtZZ2ggAEUmm”, [ Authorization = "Bearer " & access_token ], [ExcludedFromCacheKey={"Authorization"}, ODataVersion=4, Implementation="2.0"])
in
Source