An Azure service that provides an event-driven serverless compute platform.
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:
- Prove outbound reachability (from Kudu or code): Run
curl https://your-salesforce-endpointortcpping your-salesforce-endpoint 443in the Kudu/Advanced Tools console to confirm egress from the Function sandbox (Kudu service overview).curlhttps://your-salesforce-endpoint# ortcpping your-salesforce-endpoint 443 - Enable/inspect Application Insights and query exceptions (e.g.,
SocketException,TaskCanceledException, DNS errors) to confirm network‑layer issues (Configure monitoring; Investigate failures). - 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).
- 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).
- Use
nslookup your-salesforce-endpoint(ornameresolverin 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 - 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).
- 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). - 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/. - Use Azure Network Watcher Packet Capture to verify SYNs leave your VNet and responses return; export
.capand 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.