Quantcast
Channel: Microsoft Online: SharePoint Online forum
Viewing all articles
Browse latest Browse all 10096

Access denied. You do not have permission to perform this action or access this resource.

$
0
0

Hi

I am developing an Azure web job which connects to SP online and do some works each 5 min. It uses an app ID & secret for authentication and I am using CSOM to develop this.

The issue is sometimes it fails when it tries to get lists from the SharePoint site. Sometimes it works sometimes it doesn't! the error message is about permission and access, but its weird why it partially works!

I can not rely on this to develop a solution as it doesn't look really stable. following you can see I am getting lots of error committed to my SQL log table:

Error message:

Microsoft.SharePoint.Client.ServerUnauthorizedAccessException: Access denied. You do not have permission to perform this action or access this resource.
   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
   at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
   at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
   at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
   at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
   at DCI.Online.WebJob.TaskCreator.TimerJob.ProcessJob(TaskCreatorSetting setting, TraceWriter traceLogger) in C:\Users\reza\Documents\Repos\WebJob\Online.WebJob.ItemCreator\TimerJob.cs:line 52

My code:

Also I tried to run the same call by using powershell, but I got the same error message about 50% of runs:


another powershell run:


after googling the issue and lot of research I could not figure it out what is the reason for this!

Any idea or thoughts are appreciated :)

Thanks







Viewing all articles
Browse latest Browse all 10096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>