cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Yaostha Regular Visitor
Regular Visitor

https //api.powerbi.com/v1.0/myorg/datasets 403 forbidden

Hi,
I am trying to use the sample https://github.com/Microsoft/PowerBI-Developer-Samples/tree/master/User%20Owns%20Data/integrate-dash...

 

I have registered my WebApp to Azure and collected the ClientID and Client Secret.

SignIn to powerBI works fine and generate the access Token.

But when I try to get the using GetDashboards I am facing problem.

 

Exception:

'request.GetResponse()' threw an exception of type 'System.Net.WebException'
Data: {System.Collections.ListDictionaryInternal}
HResult: -2146233079
HelpLink: null
InnerException: {"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."}
Message: "The underlying connection was closed: An unexpected error occurred on a send."
Response: null
Source: "System"
StackTrace: " at System.Net.HttpWebRequest.GetResponse()"
Status: SendFailure
TargetSite: {System.Net.WebResponse GetResponse()}

Stack Trace: 

 

at System.Net.HttpWebRequest.GetResponse()
at PBIWebApp._Default.getDashboardsButton_Click(Object sender, EventArgs e) in C:\APPL\Installables\Proj files\E1\User Owns Data\integrate-dashboard-web-app\PBIWebApp\Default.aspx.cs:line 119
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 

 

Inner Exception:

{"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."}

Stack Trace:

at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.TlsStream.CallProcessAuthentication(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.ConnectStream.WriteHeaders(Boolean async)

 

 

Note: When I try to browse in IE or Chrome https://api.powerbi.com/v1.0/myorg/ I get Access Denied 

 

Regards,

Yasotha

2 REPLIES 2
Moderator Eric_Zhang
Moderator

Re: https //api.powerbi.com/v1.0/myorg/datasets 403 forbidden

@Yaostha

The sample works in my test, so I think the Power BI Servers are good. As to the error meessage "The underlying connection was closed: An unexpected error occurred on a send.", you can reference this thread.

 

By the way, when testing POST APIs, you can use Postman instead of Browsers.

Yaostha Regular Visitor
Regular Visitor

Re: https //api.powerbi.com/v1.0/myorg/datasets 403 forbidden

The sample works fine when i keep my Fiddler running in my machine.

So it means there is some port or network issue i believe.

As soon as I close the fiddler and try the sample, it goes back to same error.

 

To test, I have tested with account has PowerBI Pro and Premium and in different machine in same our network.

Same error when Fiddler is not running.

 

Is there any way I could identify what fiddler is exactly doing which helps the request to processed fine?

 

Regards,

Yasotha

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

PBI Community Highlights

PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Users Online
Currently online: 6 members 919 guests
Please welcome our newest community members: