microsoft / powerapps-tools

Unsupported PowerApps Tools & Apps
MIT License
1.04k stars 433 forks source link

[BUG]: Microsoft.Office.Compliance.Audit.DataServiceException: Tenant does not exist - After Audit turned on - Trail enviorment #1161

Closed linujohn22 closed 2 years ago

linujohn22 commented 2 years ago

Describe the bug i have turned on Audit and environment is trail . When running through the steps to set up the Center of Excellence - Audit Log via the Office 365 Management API App connector, I get an error 400 while trying to start the subscription. The error message itself is misleading and also revealing information that shouldn't be revealed (CWE-209). The error message states that my tenant doesn't exist.

Component (please tell us which flow or app you are experiencing issues with):

Solution Center of Excellence Audit Logs Version 1.0.0.7 Flow with Azure App ID registration To Reproduce Steps to reproduce the behavior:

Follow the steps in https://docs.microsoft.com/en-us/power-platform/guidance/coe/setup-auditlog Follow all steps until heading Start a subscription to the Audit Log Content, Step 5. "Test Operation" Status with error 400 appears when trying to test the connection Error message states "tenant does not exist" Expected behavior Receive a 200 status

Additional context The error message is as follows (anonymized).

Please note that the error comes from tenant ID XYZ and also states "Tenant XYZ does not exist". Also please note the information disclosed in this error message, i.e. \v\sources\dev\auditing... etc. this internal stack trace shouldn't be visible { "error": { "code": "StartSubscription [CorrId=daa44d85-d352-411e-aab7-9f63efba678d][TenantId=55b71450-03bd-428b-98e4-e4466d63c6b9,ContentType=Audit.General,ApplicationId=53693011-7e47-4987-bbca-7420ef4ce99f,PublisherId=53693011-7e47-4987-bbca-7420ef4ce99f][AppId", "message": "3693011-7e47-4987-bbca-7420ef4ce99f] failed. Exception: Microsoft.Office.Compliance.Audit.DataServiceException: Tenant 55b71450-03bd-428b-98e4-e4466d63c6b9 does not exist.\r\n at Microsoft.Office.Compliance.Audit.API.AzureManager.d52.MoveNext() in d:\dbs\sh\nibr\0616_041039\cmd\15\sources\dev\auditing\src\auditapiservice\common\AzureManager.cs:line 2116\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Office.Compliance.Audit.API.AzureManager.d__22.MoveNext() in d:\dbs\sh\nibr\0616_041039\cmd\15\sources\dev\auditing\src\auditapiservice\common\AzureManager.cs:line 550\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Office.Compliance.Audit.API.StartController.d0.MoveNext() in d:\dbs\sh\nibr\0616_041039\cmd\a\sources\dev\auditing\src\auditapiservice\apifrontendservicerole\Controllers\StartController.cs:line 76" } }

linujohn22 commented 2 years ago

it started working after 6 hours enabled Audit .