question

SureshKrishnasamy-8068 avatar image
1 Vote"
SureshKrishnasamy-8068 asked Rus7am answered

Azure web service returing Token request failed error

Hi ,
I have the Web API, which is working as a SharePoint Provider hosted app.
This application move the file from one sharepoint site library to another sharepoint site library.
When running this application in my local with the client id and secret its working, but after deploy the site in to azure its not working.
This application log the error as follows.

2021-04-28 06:13:31.5396|ERROR|McWane.SP.MoveFile.Controllers.MoveFileController|=>4/28/2021 6:13:31 AM An Error occurred: at McWane.SP.MoveFile.WorkClasses.RelocateFile.ExecuteMoveFile(MoveFileModel moveFileInfo) in C:\TFS\McWane Development Projects\Enterprise\SharePoint\RestServices\McWane.SP.MoveFile\McWane.SP.MoveFile\WorkClasses\RelocateFile.cs:line 78
at McWane.SP.MoveFile.Controllers.MoveFileController.<>c_DisplayClass3_0.<Post>b_0() in C:\TFS\McWane Development Projects\Enterprise\SharePoint\RestServices\McWane.SP.MoveFile\McWane.SP.MoveFile\Controllers\MoveFileController.cs:line 38
Message: Token request failed.

Please help me on this to resolve the issue.

FYI : the azure site name is : https://spappsehsfms.azurewebsites.net

azure-webapps
· 1
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.

Thanks for reaching here! Checking on this issue internally.

1 Vote 1 ·

1 Answer

Rus7am avatar image
0 Votes"
Rus7am answered

I've just had an issue with exactly the same symptoms: everything fine locally, but SharePoint authentication fails when deployed to Azure AppService.

I enforced TLS 1.2 and it works again:

 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;


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.