Share via

POST 400 Error

LiamG 1 Reputation point
2025-10-16T11:29:52+00:00

I am getting a POST 400 Error when trying to Post to Salesforce.

This was working fine until a few days ago.

Salesforce have confirmed the request is not getting to them

How do I check where it is getting blocked

Also

System.Runtime.InteropServices.COMException

Exception while executing function: RetrieveExternalDataOnDemand Exception binding parameter 'req' The client has disconnected An operation was attempted on a nonexistent network connection. (0x800704CD)Exception while executing function: RetrieveExternalDataOnDemand Exception binding parameter 'req' The client has disconnected An operation was attempted on a nonexistent network connection. (0x800704CD)

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.


1 answer

Sort by: Most helpful
  1. Sina Salam 28,281 Reputation points Volunteer Moderator
    2026-03-29T15:10:25.2733333+00:00

    Hello LiamG,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you are having POST 400 Error.

    When you see 400/timeout symptoms and telemetry shows no remote acceptance, treat it as a network egress problem first check DNS/NSG/SNAT/TLS before app logic (Configure monitoring; Intermittent outbound errors). The failure path is outbound from the Azure Function (connection drops or can’t establish before Salesforce), not a payload/API issue (Functions networking options; Investigate failures in App Insights).

    Follow these steps in order to resolve the issue:

    1. Prove outbound reachability (from Kudu or code): Run curl https://your-salesforce-endpoint or tcpping your-salesforce-endpoint 443 in the Kudu/Advanced Tools console to confirm egress from the Function sandbox (Kudu service overview). curl https://your-salesforce-endpoint # or tcpping your-salesforce-endpoint 443
    2. Enable/inspect Application Insights and query exceptions (e.g., SocketException, TaskCanceledException, DNS errors) to confirm network‑layer issues (Configure monitoring; Investigate failures).
    3. If the Function is VNet‑integrated, ensure outbound NSG rules allow TCP 443 to your destination (or egress path) and that routing is correct (Functions networking options; App Service VNet integration).
    4. If a corporate firewall/proxy is in-path, allow the Salesforce FQDNs/IPs and the Function’s egress IP (or NAT public IP) to pass on 443 (Functions NAT gateway tutorial; Functions networking options).
    5. Use nslookup your-salesforce-endpoint (or nameresolver in Kudu) and fix private DNS/forwarding if lookups fail, especially with Private Endpoints/Custom DNS (Private Endpoint DNS values; DNS integration scenarios). nslookup your-salesforce-endpoint
    6. Rule out SNAT exhaustion (critical): Intermittent 5xx/timeouts often mean SNAT limits; mitigate with connection pooling, Premium plan + VNet Integration + NAT Gateway, or service endpoints (Intermittent outbound errors / SNAT; Control outbound IP with NAT Gateway; SNAT with Load Balancer).
    7. You can enforce modern TLS from code or platform, prefer OS default (TLS 1.2+) or set explicitly only when required example legacy snippet: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls(See .NET TLS best practices and App Service TLS updates, including TLS 1.3 rollout) (TLS guidance; App Service TLS update).
    8. Add resilient HTTP handling: Reuse HttpClient (pooling) and set sane timeouts, e.g., httpClient.Timeout = TimeSpan.FromSeconds(100); to reduce new sockets and avoid SNAT pressure (Intermittent outbound errors → use connection pools; additional mitigation practices (blog) https://fhessen.com/2025/01/23/snat-and-why-it-matters-when-working-with-azure-services/.
    9. Use Azure Network Watcher Packet Capture to verify SYNs leave your VNet and responses return; export .cap and analyze in Wireshark (Packet capture overview; Manage packet captures).

    I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.