0

When doing the trailhead module it makes all connections using a dev Edition, when using a production environment that has the devhub. Can the connected app can be created in a sandbox or does it need to be in prod? I would like to test some functionality, making the ci/cd from git to a specific sandbox and not getting stuff to prod environment. Is this possible?

  • The connected app needs to be created in the devhub but the actual ci/cd wont need to point to a production env. You have flexibility there. – Zack Walton Feb 7 '19 at 17:17
  • @ZackWalton To be pedantic, the Connected App needs to be created in an org, it need not be production. However, that org should be a "permanent" org to avoid losing the connected app when the org is destroyed. – sfdcfox Feb 7 '19 at 17:26
1

the connected app can be created in a sandbox or need to be in prod?

The connected app has to be created in the DevHub, which typically will be Prod.

I would like to test some functionality, making the ci/cd from git to a specific sandbox and not getting stuff to prod environment. Is this possible?

Yes, this is possible. Just by creating the connected app in Prod does not signify that your CI/CD process will build/deploy in Production. The connected app here provides a headless way of authorizing the CI user to be able to create Scratch Orgs, run CLI commands and perform the CI/CD process on behalf of the CI User. Excerpt from the trailhead:

However, you’ll need a way to manage the authorization process, because you’re not there to personally log in when your CI or build automation job runs.

...

Basically, for our purposes, it enables your headless process to connect to the Dev Hub and execute Salesforce CLI commands.

  • It need not be the dev hub, but it should be an org that is "permanent", such as a Developer Edition org, and definitely not a trial org or sandbox. – sfdcfox Feb 7 '19 at 17:27
  • It may not be Prod (and thus used typically), but it has to be DevHub, right? – Jayant Das Feb 7 '19 at 17:30
  • It can be any org, you just need to have the consumer id and secret. It need not be your dev hub or your production. For example, I could create an app in my dev org, and give it to you, and you could use it. This is how connected apps are designed to work. – sfdcfox Feb 7 '19 at 18:04
  • Connected apps are fine. And you will need the consumer id/secret from the Org where you will want to login. But if you have to use it in context for CI/CD using SFDX, then I would imagine you will need the Connected app to be created in Dev Hub, as you will want to login to Dev Hub say to be able to create Scratch Orgs for your CI process. – Jayant Das Feb 7 '19 at 18:07
  • Connected Apps authenticate the application, not the user. It doesn't matter where the app is, as the user will log in to whichever org they want using that app. – sfdcfox Feb 7 '19 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.