Azure-Samples / power-bi-embedded-integrate-report-into-web-app

A Power BI Embedded sample that shows you how to integrate a Power BI report into your own web app
MIT License
134 stars 152 forks source link

InvalidAuthenticationTokenTenant when creating a workspace collection #78

Open Cheelax opened 7 years ago

Cheelax commented 7 years ago

Hi, I am at the moment working on a poc using the PowerBi embedded sample. So I created the necessary elements in azure. I am now trying to "provision a new workspace collection" but when I try to create it, the azure connexion page is pushed, I log in and the console shows the following message:

Ooops, something broke: Status: Unauthorized, Reason: Unauthorized, Message: {"error": {"code":"InvalidAuthenticationTokenTenant","message":"The access token is from the wrong issuer 'https://sts.windows.net/935315d9-fd2e-48a9-b4c5-1a3b03ac5d2f/'. It must match the tenant 'https://sts.windows.net/5204e034-9910-472c-b3b4-b56d54860cc8/' associated with this subscription. Please use the authority (URL) 'https://login.windows.net/5204e034-9910-472c-b3b4-b56d54860cc8' to get the token. Note, if the subscription is transferred to another tenant there is no impact to the services, but information about new tenant could take time to propagate (up to an hour). If you just transferred your subscription and see this error message, please try back later."}}

I looked for the wrong issuer in the project to change it but i don t find it... Any advice to solve my problem? Thank you.

cloudymark commented 7 years ago

for me, this was because i was accessing another tennant, but signed into a different one.

change the following

static AuthenticationResult GetCommonAzureAccessToken() { var authContext = new AuthenticationContext(string.Format("{0}/common/oauth2/authorize", authUrl)); var result = authContext.AcquireToken( resource: armResource, clientId: clientId, redirectUri: redirectUri, promptBehavior: PromptBehavior.Always);

shuklajay commented 7 years ago

Hi, I am facing below exception while importing .pbix file to azure portal Exception thrown: 'Microsoft.Rest.HttpOperationException' in mscorlib.dll Exception thrown: 'Microsoft.Rest.HttpOperationException' in mscorlib.dll Exception thrown: 'Microsoft.Rest.HttpOperationException' in mscorlib.dll Exception thrown: 'System.ArgumentNullException' in Microsoft.Rest.ClientRuntime.dll Exception thrown: 'System.ArgumentNullException' in mscorlib.dll Exception thrown: 'System.ArgumentNullException' in mscorlib.dll at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings) at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonConverter[] converters) at ProvisionSample.Program.d24.MoveNext() in E:\Jay Shukla\SparkDownloads\powerbi\ProvisionSample\Program.cs:line 166 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at ProvisionSample.Program.<>c.<

b22_0>d.MoveNext() in E:\Jay Shukla\SparkDownloads\powerbi\ProvisionSample\Program.cs:line 78 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Microsoft.Threading.AsyncPump.Run(Func`1 func) in E:\Jay Shukla\SparkDownloads\powerbi\ProvisionSample\AsyncPump.cs:line 33 The thread 0x2eb0 has exited with code 0 (0x0). The thread 0x2eb4 has exited with code 0 (0x0). The thread 0x2c04 has exited with code 0 (0x0). The thread 0x2028 has exited with code 0 (0x0). The program '[8168] ProvisionSample.vshost.exe' has exited with code 0 (0x0).

Any advice to solve this issue will be entertained as early as possible? Thanks you.