Preventing plug-in timeouts when calling a slow external web service

Create a Dataverse plug-in
Answer Correct answer: D — Set the HTTP connection KeepAlive property to false so the plug-in does not time out when interacting with a slow or failing external web service.

A company requires a plug-in that makes multiple requests to an external web service. The plug-in must not time out when the web service has issues or is slow to respond. You need to create the plug-in. What should you do?

  1. Assign the IOrganizationService object to a member variable.
  2. Register the plug-in to run synchronously.
  3. Register the plug-in step once for each web service request.
  4. Set the HTTP connection KeepAlive property to false. Correct Answer

Community Votes

D
60%
B
40%

60% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

Microsoft's best practice for plug-ins that interact with external hosts is to set KeepAlive to false on the HTTP connection. Reusing a kept-alive connection to a slow/unresponsive host is a common cause of plug-in timeouts; disabling KeepAlive forces a fresh connection per request.

A plug-in makes multiple calls to an external web service and must not time out when that service is slow or failing. The documented remedy is to set the HTTP connection KeepAlive property to false when the plug-in interacts with external hosts, which avoids connection-reuse timeouts.

Choosing B (register synchronously). Synchronous plug-ins have a 2-minute execution limit and are worse for slow external calls; the actual fix for external-host timeouts is the KeepAlive setting, not the execution mode.

Community Discussion (6 comments)

Juan0414 👍 1 Selected: D
B can not be. Synchronous plug-ins have a 2-minute execution time limit.(https://learn.microsoft.com/en-us/power-apps/developer/data-platform/analyze-performance#time-and-resource-constraints) Also, KeepAlive doc: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/best-practices/business-logic/set-keepalive-false-interacting-external-hosts-plugin#symptoms
1285cc6 👍 1 Selected: B
If you try to use KeepAlive on a closed connection, it will cause the plug-in to fail(time out): taken from MS Docs: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/best-practices/business-logic/set-keepalive-false-interacting-external-hosts-plugin Register plugin as synchronous. It will throw an error and not timeout.
PRash3566 👍 1 Selected: D
IMO: D
mattymecubic 👍 1 Selected: D
IMO: D
FCTopics 👍 3
https://learn.microsoft.com/en-us/power-apps/developer/data-platform/best-practices/business-logic/set-keepalive-false-interacting-external-hosts-plugin Correct answer is D. If option B instead of synchronous would put asynchronous then I would have my doubts, but synchronous is not the way to go.
pey 👍 1 Selected: B
This allows the plug-in to continue processing without waiting for the web service response, reducing the risk of timeouts.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

When a plug-in calls external web services, Microsoft's documented best practice is to set the HTTP connection KeepAlive property to false. Keeping a connection alive and reusing it against a slow or unresponsive external host leads to timeouts; disabling KeepAlive ensures each request uses a fresh connection and reduces the chance of stalling.

Why the Other Options Are Wrong

Registering the plug-in synchronously (B) imposes a 2-minute execution limit and makes timeouts more likely, not less. Assigning IOrganizationService to a member variable (A) is a general coding practice, not a timeout fix. Registering one step per request (C) adds overhead without addressing external-host latency.

Community Comment Notes

FCTopics (likes=3) links the official 'set KeepAlive false' best-practice article as the correct answer. Juan0414 (likes=1) notes synchronous plug-ins have a 2-minute limit, ruling out B.

Official Reference

Related Analysis

Practice All PL-400 Questions

Access 85 questions with complete answers and detailed explanations.

View Full PL-400 Practice Test →

← Back to PL-400 Study Guide