0

In our CICD pipelines, we used to authorize devhub first using sfdx auth url and then create scratch orgs using same devhub. We use the command "sfdx force:org:display --verbose" to get the sfdx auth urls of the scratch orgs which we subsequently use for other CI processes in the pipeline. We thought of switching to JWT bearer flow to authorize devhub due to the frequent expiration of the refresh token which disrupts the pipelines. We were successfully able to authorize the devhub using the JWT approach but after that on using "sfdx force:org:display --verbose" command, we are not able to get the sfdx auth url for the scratch org. I read and found that it is an expected behavior. Since all our pipelines are already set up, now authorizing scratch org with another approach would require a major pipeline design change. Is there any workaround to generate the sfdx auth url for the scratch orgs after authorizing devhub with JWT flow?

1 Answer 1

0

I suggest to authorize devhub and store authorization token in a Github Action secret, and then retrieve it using secret.

I don't recommend to use JWT Flow for CI/CD integration

2
  • Patlatus - We are doing the same method as suggested here i.e. authorize devhub and store authorization token in a Github Action secret, and then retrieve it using secret. But want to know is there any reason to not use JWT Flow for CI/CD integration?
    – Sarang123
    Commented Oct 11, 2023 at 15:41
  • well, it would be more complex to setup and manage I believe, to follow KISS principle it is better just to follow the simplest way. Still, this is not clear from your question why you can't get the scratch org SFDX URL. I can confirm that if I use suggested approach, I am able to get the scratch org SFDX URL
    – Patlatus
    Commented Oct 16, 2023 at 12:05

You must log in to answer this question.

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