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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Issue when scheduling refresh using postman rest api public key

Hi,

  I just loaded a data in power bi dsktop using postman rest api as below in blank query 

actualUrl = "http://*******************?",
options = [Headers =[#"Content-type"="application/json",
#"Authorization"="***************"]],
result = Web.Contents(actualUrl, options)

In desktop, data loaded properly in anonymous connection. But in service it's showing Failed to update data source credentials. Why anonymous connection it's not working in service?

Can you please help me to resolve this

 

Thanks,

Krithika

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Would you please try to select the "skip test connection" option? For more details, please refer to https://kohera.be/blog/power-bi/the-hidden-gems-of-the-function-web-contents/

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

View solution in original post

9 REPLIES 9
ibarrau
Super User
Super User

Hi. Sometimes Power Bi Service needs more detail about the url. It needs to understand which part of the URL means what. That is why it is a good practise to split in the correct parameteres. Check this post out showing relative path and query path:

https://blog.crossjoin.co.uk/2016/08/16/using-the-relativepath-and-query-options-with-web-contents-i...

This can help Power Bi to identify the source and credentials.

Hope this helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Anonymous
Not applicable

Eventhough it is not working. Data can be pulled in desktop and still in service can't able to refresh. It's showing refresh error as failed to update data source crendentials. since it's public key doesn't have credentials

Hi @Anonymous ,

 

Would you please try to chang your anonymous to "basic" connection on power bi desktop and passed the API key as the username (left password blank).

But make sure you get rid of API key in your advanced editor if you did set one.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

Anonymous
Not applicable

Hi 

 

Hi @Anonymous ,

 

Would you please try to select the "skip test connection" option? For more details, please refer to https://kohera.be/blog/power-bi/the-hidden-gems-of-the-function-web-contents/

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

Anonymous
Not applicable

Thanks Dedmon, that has worked wonders for me. Thanks.

Ok let's add the key as headers. Check this example: if your URL is this one "https://swapi.dev/api/people/?search=Skywalker" you can build this:

let
Json_body = Json.FromValue("{ ""first_param"": ""AAAAA"",  ""second_param"": ""BBBBBB""}",),
Source = Json.Document(Web.Contents("https://swapi.dev/api/", [
    RelativePath="people/",
    Query=[search="Skywalker"],
    Headers=[
        #"Content-Type"="application/json", 
        Otherparameter"ValueOfParameter"
    ], 
    Content=Json_body
]))
in
Source

 That is an example with body and headers. Try adding your public key there like in postman.

Regards,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Can you show the complete error message? In addition, please be sure to have the credentials configurated in the schedule refresh options like this:

 

ibarrau_0-1599666492774.png

You can specify anonymous and sign in without anything else. This is an example of a dataset I have connected exactly like you.

Regards,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Anonymous
Not applicable

Hi,

   I am getting the below error, when I tried in anonymous

krithikalakshmi_0-1599813360947.png

 

Regards,

Krithika

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors