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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Yaostha
Helper II
Helper II

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
Eric_Zhang
Employee
Employee

@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.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.