I built a changeset and I was able to include all my classes, but it was a surprise that salesforce has not provided any option to deploy a connected app.

So how do I go about deploying a connected app? Do I need to create it in every other environment?

List Of Components

2 Answers 2


One organization acts as the "host" of the connected app. All other orgs will automatically "install" it on the first use in that org. There's no need to package it up or deploy it anywhere. If you were to create it in every other org, you'd have unique client ID and client secret values, which would be disastrous at best. I would say you should create your Connected App in a permanent org (production or a DE org), rather than a Sandbox, which could be destroyed, coincidentally deleting the Connected App.

  • So I should directly create the connected app in the production org environment.
    – abhi
    Mar 25, 2015 at 16:53
  • @abhi Yes, indeed. It'll propagate to your sandboxes as necessary.
    – sfdcfox
    Mar 25, 2015 at 17:51
  • 1
    @sfdcfox I hope you're right, but even 'official' Salesforce pages mention that connected apps in Sandbox orgs need to be recreated (with a different name): help.salesforce.com/… Apr 29, 2015 at 13:01
  • 1
    While it's true they are not copied automatically, the first use logic I described is true. We have two connected apps for each of our integrations in Salesforce; one for production, and one for sandboxes. When we spin up a new sandbox, we simply reuse the client ID from the app we have in production. We never create new connected apps in Sandboxes.
    – sfdcfox
    Apr 29, 2015 at 18:41
  • 1
    @WillemMulder It's working as intended. The documentation for OAuth2 and this help text are both technically correct. The help says they aren't installed automatically, which is true, but OAuth2 docs say it will be installed on first use, which is also true. I think the help text just happens to be misleading.
    – sfdcfox
    Apr 30, 2015 at 20:00

the refresh from PROD to Sandbox - destroys any prior existing Connected app, also from prod - new sandbox wont get created on sandbox either (either with partial copy from prod or from full refresh from prod).

this is a bit of limitation or constraint for us.

it wont even allows to create new connected app on sandbox with same API name ! this makes things more complicated. everytime we need to create new API name and change all related classes / pages to point to new API name !

  • This is true. I found this today. It is a major burden since we have 4 full sandbox environments + developer environments. If there's an idea out there that needs to be upvoted, this is one.
    – abhi
    Apr 29, 2015 at 18:33
  • I found the idea that needs to be upvoted.
    – abhi
    Apr 29, 2015 at 18:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .