4

We have an Remote Event Receiver which is deployed in Azure and running for an SPO site.

It was running fine, but from yesterday, it is not working properly.

After a detailed investigation, we found an error from Application Insights.

Error Details:

ExecuteQuery threw following exception: System.Net.WebException: The remote server returned an error: (401) Unauthorized

Can anyone tell, what is happening here?

2
  • 1
    just one question, are u using app client id? Mar 14, 2018 at 7:04
  • yes. That's correct. We are using Client id and Secret Id for authentication. Mar 14, 2018 at 7:16

1 Answer 1

11

Could you please check as if your client id is expired or not. Generally this error can be found when the Client Secret Id got Expired. To get the end date of when the client secret will expire you have to query the application keys using the client Id. If the current secret id is expired then you have to remove the it and create a new one.

I thing this article will be helpful for to do the procedure.

Update: Because of some changes from Microsoft end, there is a new scenario which will not be resolved by the previous methodology. And the resolution is to add a key in the Azure Application Settings as provided bellow:

key: WEBSITE_ADD_SITENAME_BINDINGS_IN_APPHOST_CONFIG 
value: 0 

Here is the article which have described it elaborately with the reason of the issue.

Let me know if it works.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.