Forum Discussion

kevinglb's avatar
kevinglb
Frequent Visitor
4 years ago

Issue - Update Data Source Credentials through REST API failed for Web Source

 

I was trying to update the data source credentials through REST API (https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId}) for a PBI report whose data source tpye is "Web" and it is from a CSV file on SharePoint site. I chose "OAuth2" as credential type in the body but got errors as below:

It says the credentials for the web source are invalid.

 

However I used the same credential type and same token for another PBI report (data source type is "SharePoint List" and they are pointing to the same sharepoint site), and the REST API call was made successfully.

 

Could anyone tell me what's missing during this operation for the websource or is there anything I can do to make the call succeed.

 

 

5 Replies

Replies have been turned off for this discussion
  • kevinglb's avatar
    kevinglb
    Frequent Visitor

     We experience issue when we are trying to refresh the PBI report through REST API call: https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/refreshesThe data source for the report is from SharePoint, so it needs data source credentials, we used https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId} to update the credentials by passing access token, and the call succeed, and we can see there is no waning message showing up for that dataset at app.powerbi.com, which means the credentials are updated.

    However the refresh result is failed and it says "The credentials provided for the SharePoint source are invalid. " It failed every time when the credentials are updated through the above REST API call.

    But if we update the credentials by "Edit Credentials" at app.powerbi.com manually and login with the same account which is used to get the token, the refresh results are always good.

     

    Please let me know whether this is a known issue or not and what should I do to make the credentials updated and valid for the report refresh operation.

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi kevinglb,

      How did you config 'get data' operations from that data source? Can you please share some more detail to help us clarify and troubleshoot your scenario?

      How to Get Your Question Answered Quickly  

      In addition, you can take a look at the following link to directly get data from the link of the files that are stored in onedrive/sharepoint:

      Use OneDrive for Business links in Power BI Desktop - Power BI | Microsoft Docs

      Regards,

      Xiaoxin Sheng

      • kevinglb's avatar
        kevinglb
        Frequent Visitor

        Hi Xiaoxin,

         

        Followings are the steps that I used to get data from SharePoint:

         

        1. Get Data -> SharePoint Folder -> enter the root URL of the site 
        2. Click "Transform Data" -> Select the files you want to use by filtering the folder path / extension , then combine them

        3. Build visualization model based on the data just loaded and save locally

         

        And I also tried the way you suggested through the link to get data by enter the URL of the Excel / CSV file and the data is retrieved same as above method.

         

        I believed the problem occurs during the credentials validation process rather than the getting data process for the report.

         

        If you can let us know whethere there are known issues for the refresh operation or credentials update operation that will be helpful as we can re-arrange our develppment plan. 

         

        Thanks,

  • IAmStandard's avatar
    IAmStandard
    Frequent Visitor

    Hi kevinglb , Anonymous ,

     

    I have exactly the same issue. I'm pretty sure it's because we don't patch a "refresh token" with the credential API. When we refresh the dataset, I think it it takes more that x minutes, Power BI Services wants to refresh the token with an access token. Since we didn't put an access token (not supported with the API), it fails.

     

    That's pretty annoying because I have no workaround in mind right now...