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

TFS anonymous access

Hi,

 

I'm blocked and I need your help. I would like to do on PowerBI a POST API request on a TFS server which works fine on Postman but I always the same issue on PBI:

DataSource.Error: Web.Contents with the Content option is only supported when connecting anonymously.
Details:
DataSourceKind=Web
DataSourcePath=http://{instance}/DefaultCollection/{project}/_apis/wit/

 

The request is:

 

let
    url = "http://{instance}/DefaultCollection/{project}/_apis/wit/wiql?api-version=3.0",
    content = "
    {""query"": ""
        SELECT *
        FROM WorkItemLinks 
    	WHERE 
		    ([System.Links.LinkType] = 'System.LinkTypes.Dependency-Forward') 
		    AND Source.[System.WorkItemType] = 'Requirement' 
		    AND Source.[System.State] <> 'Closed'
			
		    AND ( Target.[System.WorkItemType] = 'Task' 
				OR Target.[System.WorkItemType] = 'Bug')
		    AND Target.[System.State] <> 'Closed'
	    ORDER BY [System.Id] 
	    ASOF '1/1/15'    
        mode(maycontain)""
    }",
    Source = Json.Document(Web.Contents(url,[Headers = [#"Content-Type"="application/json"], Content = Text.ToBinary(content) ] ))
in
    Source

As said below, on Postman, it works fine using NTLM Authentication method. So I do not known if the issue coming from the authentication method used on powerbi (basic GET API rest method works) or if the method is not correctly written ...

 

3 REPLIES 3
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

 For the error message, I think you didn't choose Anonymous authentication for the web data source.

 

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

2.PNG

 

q2.PNG

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you @v-xuding-msft 

I already tried this solution, but it doesn't work:

 

Untitled.png

 

 

 

 

 

 

I also tried a POST request which doesn't need authentication, and every thing is ok, I suppose that I need to include authentication parameters into my request. 

Anonymous
Not applicable

After several investigations I found the issue but I didn't find the solution yet ...

Using basic authentication, when I run the query I have following issue :

 

"Expression.Error: The 'Authorization' header is only supported when connecting anonymously. These headers can be used with all authentication types: Accept, Accept-Charset, Accept-Encoding, Accept-Language, Cache-Control, Content-Type, If-Modified-Since, Prefer, Referer"

 

So, I changed the connection setting but, when I try to connect with Anonymous access to TFS I have following issue:Untitleds.jpg

 

 

 

 

 

 

 

 

 

 

 

I tried with the TFS2017 OnPrem version of my compagny, with my personal ADOS, still the same issue, I couldn't connect to TFS anonymously ...  Any idea ? 

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.