Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Unable to set OAuth credential for Azure AD Graph API in Power BI Service

I am trying to get the Azure AD users detail with Azure AD Graph API (https://graph.windows.net/myorganization/users/{id}?api-version=1.6)

 

It is working fine in the Power BI desktop but the data source credential does not work after i published to Power BI services.

 

below is script to get the user details.

 

let
    Source = #"Data Source Reference",
    #"Removed Other Columns" = Table.SelectColumns(Source,{"ID"}),
    #"Removed Duplicates" = Table.Distinct(#"Removed Other Columns"),

    APIRequest = (Path) =>
    let
        Host = "https://graph.windows.net/myorganization",
        APISource = Json.Document(Web.Contents(Host, [RelativePath = Path])),
        Success = APISource
    in
        Success,
    Output = 
        Table.AddColumn(
        #"Removed Duplicates", 
        "API Request", 
        each try APIRequest("users/" & [ID] & "?api-version=1.6") otherwise null
      ),
    #"Expanded API Request" = Table.ExpandRecordColumn(Output, "API Request", {"city", "physicalDeliveryOfficeName", "displayName", "mail", "jobTitle"}, {"City", "Office", "DisplayName", "Email", "Job Title"})
in
    #"Expanded API Request"

 

 

The error message that i have received are as below.

kh_acc_2-1667286531126.png

 

 Thanks in advance.

 

Status: Investigating

Hi @kh_acc ,

 

Here is a user who encountered the same problem as you and solved it successfully, this post is for your reference:powerbi - How to fix the message The OAuth authentication method isn't supported for this data sourc...

 

Best regards,

Community Support Team _Yadong Fang

Comments
v-yadongf-msft
Community Support
Status changed to: Investigating

Hi @kh_acc ,

 

Here is a user who encountered the same problem as you and solved it successfully, this post is for your reference:powerbi - How to fix the message The OAuth authentication method isn't supported for this data sourc...

 

Best regards,

Community Support Team _Yadong Fang

kh_acc
Regular Visitor

Thanks @v-yadongf-msft ,

 

But I don't think it is quite the same cause the fixed given was for Excel in Sharepoint where there is a connector for that and also I managed to make it working in Power BI desktop but not Power BI service.

 

Power BI desktop

kh_acc_1-1667396722747.png

 

 

Power BI Services

 

kh_acc_0-1667396677200.png