@Anonymous , Thanks for the follow-up and update.
Based on your last comment, I understand you have resolved the issue.
Glad to know that the issue is resolved.
You may always checkout: Troubleshoot virtual network integration with Azure App Service
To benefit the community, I can post a summary of this issue:
Symptom:
Upon deploying ASP.NET MVC WebAPI application to Azure Web App services, using the HttpClient.PostAsync method to send requests to a third-party API results in an error. While the process works smoothly on a local IIS server with a successful 200 response, in the Azure environment, the operation fails with an error message indicating "one or more errors:: system.task.. Boolean…," and an associated error code of 500.
The same publish works fine another Azure WebApps.
Fix: (by Cherryinfy)
The issue was arising due to the integration of the networking Virtual Network (VNet). After making certain modifications to the VNet configuration, the API calls are now functioning correctly.
Kindly let us know, thanks for your cooperation!
(I'll convert this comment to answer)