cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
yakkalipavan Frequent Visitor
Frequent Visitor

Web.Contents with the Content option is only supported when connecting anonymously.

Hello All,

 

 

I am connecting to api using basic token. but I am getting the authentication issue which is  "Web.Contents with the Content option is only supported when connecting anonymously." i Knew it is very common error and gone thorugh all the below links

 

https://community.powerbi.com/t5/Service/Anonymous-access/m-p/21014#M5916

 

http://community.powerbi.com/t5/Developer/Using-a-REST-API-as-a-data-source-Web-Contents-Content-opt...

 

http://community.powerbi.com/t5/Service/Cannot-sign-in-with-Anonymous-Authentication-for-a-Web-API/t...

 

 

the power Query is 

 

 

let 
AuthKey = "Basic  mytoken",
url="https://tfs.mnsu.edu/tfs/ITS%20AppDev/Test%20Agile%20Project/_apis/wit/wiql?api-version=1.0",
body="{
  ""query"": ""Select [System.Id], [System.Title], [System.State] From WorkItems Where [System.WorkItemType] = 'Task' and [System.AreaPath]='Test Agile Project'""
}",

Source = Json.Document(Web.Contents(url,[
         Headers = [#"Authorization"=AuthKey ,
                    #"Content-Type"="application/json"],
            Content = Text.ToBinary(body)
            ]
        ))
    
in
   Source

 

and error i am getting is 

error.JPG

 

can anyone please hemp

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator v-qiuyu-msft
Moderator

Re: Web.Contents with the Content option is only supported when connecting anonymously.

Hi @yakkalipavan,

 

From your description, you already provide the access key in Power Query, but you didn't choose Anonymous authentication for the web data source, so the error throws out.

 

Please open Data Source Settings, then find the web data source, choose Anonymous like below: 

 

q2.PNG

 

Update: Please mask the actual data source domain name in the screenshot. 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Moderator v-qiuyu-msft
Moderator

Re: Web.Contents with the Content option is only supported when connecting anonymously.

Hi @yakkalipavan,

 

From your description, you already provide the access key in Power Query, but you didn't choose Anonymous authentication for the web data source, so the error throws out.

 

Please open Data Source Settings, then find the web data source, choose Anonymous like below: 

 

q2.PNG

 

Update: Please mask the actual data source domain name in the screenshot. 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Vicky_Song Established Member
Established Member

Re: Web.Contents with the Content option is only supported when connecting anonymously. - Status changed to: Needs Info

 
davidalves Frequent Visitor
Frequent Visitor

Re: Web.Contents with the Content option is only supported when connecting anonymously.

Hi @yakkalipavan,

 

Have you resolved this?

 

It's working for me with Anonymous authentication in Desktop.

 

let     
    Source = (Collection as text, QueryID as text) => let
    AuthKey = "Basic APIKEY(camouflaged-> i use Postman)",
    url="https://tfs.primaverabss.com/tfs",
    Source = Json.Document(Web.Contents(url,[
    Headers = [#"Authorization"= AuthKey ,
                #"Content-Type"= "application/json"],
                RelativePath= Collection & "/_apis/wit/wiql/"& QueryID &"?api-version=1.0"
              ]
                        ))
    
in
   Source
in
   Source

But when i publish this in web i can't use any credentials because this error:

asd.JPG

Can anyone help me?

 

Best Regards,

David Miguel Alves

 

yakkalipavan Frequent Visitor
Frequent Visitor

Re: Web.Contents with the Content option is only supported when connecting anonymously.

Thanks for your help. Yes I followed your step and issue got resolved

Moderator v-qiuyu-msft
Moderator

Re: Web.Contents with the Content option is only supported when connecting anonymously.

Hi @davidalves,

 

As your issue happens in Power BI service, while this thread talks about in Power BI desktop. I would suggest you post a new thread in this forum. 

 

@yakkalipavan As your issue is solved now, I will close this thread. Thanks for your update. 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ldroguett Frequent Visitor
Frequent Visitor

Re: Web.Contents with the Content option is only supported when connecting anonymously.

Pudiste solucionar esto? tengo el mismo problema, voy a subirlo en web y no puedo validar las credenciales....

devangddave Occasional Visitor
Occasional Visitor

Re: Web.Contents with the Content option is only supported when connecting anonymously.

Hi, I want to call the POST method of API using windows authentication in power bi.

So I can't set it to Anonymous because API is hosted to use only Windows Authentication.

 

Any suggestion, please

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)