martinagrom / Office365Scripts

Some helpful PowerShell scripts for Microsoft Office 365
27 stars 18 forks source link

Not able to complete the Test code #1

Closed Raj-MCITP closed 5 years ago

Raj-MCITP commented 6 years ago

Need your help please. Getting below error when I try to test it

{ "id": "33f6200a-d2fb-4a71-94a2-9c93a394b0bc", "requestId": "a858adcf-01a3-4a2e-a8aa-5d455030f786", "statusCode": 500, "errorCode": 0, "message": "An error has occurred. For more information, please check the logs for error ID 33f6200a-d2fb-4a71-94a2-9c93a394b0bc" }

and the logs as

2018-02-13T03:23:38 Welcome, you are now connected to log-streaming service.2018-02-13T03:24:38 No new trace in the past 1 min(s).2018-02-13T03:25:38 No new trace in the past 2 min(s).2018-02-13T03:26:36.852 Function started (Id=b4e73e80-1d41-43c9-9711-e36d1d7a1d8a)2018-02-13T03:26:36.977 TenantID 00c118a9-2de9-41d3-xxxxxxxxxxxxx -ClientKey JspDWHPG+/8aEYVMO2YEVPWJjydFHGxxxxxxxxxx -AppID 9b34e4ba-xxxx-463e-8352-4e0b93640ef72018-02-13T03:26:37.711 ERROR! The remote server returned an error: (403) Forbidden.2018-02-13T03:26:37.711 []2018-02-13T03:26:37.867 ERROR! The remote server returned an error: (403) Forbidden.2018-02-13T03:26:37.977 Invoke-RestMethod : The remote server returned an error: (403) Forbidden.at run.ps1: line 104+ Invoke-RestMethod+ _____ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand2018-02-13T03:26:37.992 ERROR! The remote server returned an error: (400) Bad Request.2018-02-13T03:26:38.012 ERROR! The remote server returned an error: (400) Bad Request.2018-02-13T03:26:38.041 Exception while executing function: Functions.ProvisionGroup. Microsoft.Azure.WebJobs.Script: PowerShell script error. Microsoft.PowerShell.Commands.Utility: The remote server returned an error: (403) Forbidden.2018-02-13T03:26:38.086 Function completed (Failure, Id=b4e73e80-1d41-43c9-9711-e36d1d7a1d8a, Duration=1235ms)2018-02-13T03:28:38 No new trace in the past 1 min(s).2018-02-13T03:29:38 No new trace in the past 2 min(s).2018-02-13T03:30:38 No new trace in the past 3 min(s).2018-02-13T03:31:38 No new trace in the past 4 min(s).2018-02-13T03:32:38 No new trace in the past 5 min(s).2018-02-13T03:33:38 No new trace in the past 6 min(s).

martinagrom commented 6 years ago

Hi Raj, it seems your AAD app has not all permissions set that are necessary: The remote server returned an error: (403) Forbidden.at run.ps1: line 104+ Pls. check out our article http://blog.atwork.at/post/2017/09/28/Provisioning-an-Office-365-group-with-an-approval-flow-and-Azure-functions-part-1 and the section "Update December 2017: All App permissions" - there you should find all settings. hope it helps! br, Martina