question

chandrasekharbheemuni-0980 avatar image
0 Votes"
chandrasekharbheemuni-0980 asked Jerryzy answered

Azure function showing error as "The remote server returned an error: (401) Unauthorized."

Dear All,

Recently we are seeing wired issue in Azure function and showing error as below highlighted. The purpose of the Azure function to install custom application in new site collection and it is executing from the MSO workflow. It is working fine from last 6 months and stopped working from last 3 weeks. showing log errors (see below log) when it is executing from flow or manual Function Test/Run.

In order to find the root cause of this issue we have verified below settings.

  • Function (user) account has enough permissions

  • Same function is working fine in UAT environment

  • Compared function app and function permissions in both production and UAT, both are looks good

Kindly review below log and let me know if I missed anything.

Your suggestions will much appreciated.


Error in Log:

92152-image.png










office-sharepoint-onlineazure-functions
image.png (239.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Jerryzy avatar image
0 Votes"
Jerryzy answered

Hi @chandrasekharbheemuni-0980 ,

From the error message, it specify the "token request failed", so I assume you have registered App Client Id/Secret for getting the token.

And this function is working in UAT, permission also the same.

so I think maybe the Client Secret is expired, you can check this point in your production environment.

If this is no related to the issue, please test the C# code in a local console application to see if the error can be reproduce and check the detailed code line which throw the exception.

Thanks
Best Regards



If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.