I'm working towards moving an existing managed package over to the SFDX CLI metadata format.
Part of the application is a Connected App which forms a core part of a SSO process to an external system via Canvas. So I can't really leave it out of the scratch orgs without taking out other large sections of functionality.
I've found in the past that it isn't possible to include the oauthConfig > consumerKey in the SFDX CLI metadata as that key is unique to the org it was generated in.
After excluding the consume key from the .connectedApp-meta.xml file I can successfully push the source to a new scratch org.
However, now when I try an push an unrelated change to a Visualforce page to the scratch org I'm getting an "invalid cross reference id" error on the connectedApp. I'm not sure why the CLI is trying to push the connected app again. I haven't made any changes to it. Maybe it has detected the new consumer key that was generated on first push?
I did find a similar question with relation to profiles - Salesforce DX: Pushing profiles gives 'invalid cross reference id'. The suggestion there was to make an arbitrary change to the metadata in Salesforce and then pull it down again.
Trying that, I get the following error:
A general data error occurred with your entries
Any ideas on how to get the connected app into the Scratch org and then being able to work with the org afterwards?