Forum Discussion

Yaostha's avatar
Yaostha
Helper II
8 years ago

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-dashboard-web-app

 

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

  • Eric_Zhang's avatar
    Eric_Zhang
    Microsoft 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.

    • Yaostha's avatar
      Yaostha
      Helper II

      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