Power Platform Connection References explained
In order to understand how connection references work , Connections must be explained first.
Introduction
This article is trying to go in depth on how the connections ecosystem in Power platform works and connect this knowledge to problems faced with reference in cross tenancy ALM.
Connections
The connection contains all the information needed to connect to any system. Every single connector in the power platform stack after their creation , anyone with the right permission can create a connection. That is the same for custom connectors.
With some connectors there are more then one way to create a connection. The basic connection type is using a user credentials ,however, the best approach and available in most of the connectors is to use a service principal. Using a service principal is critical some time since MFA can be bypassed, password expiry policy and other policies that a common user could have. Is simple words it decouples the connection from the user. This ability though sometimes makes it complicated to a simple user since mote then one connection can be used, several user credentials and service principal. If a service principal is present this is what must be used as a best practices approach at all times.
Connection references
Having connections explained it is now important to define references. Someone would expect that this will take time and complex diagrams, however , Connection references are just a form of storage for metadata. Literally a metadata text file stored in Dataverse that defines which connector is being used and there fore which connection is needed. The part that is missing for everyone , especially when implementing Dev-ops pipeline is that references do not contain any credentials. That makes it impossible to work on another environment by simply importing the solution.
The bad news
Unfortunately the only way to make connections references work on another environment is to actually create them manually first. Then the populating the Deployment Settings file with the LogicalName and ConnectorId values from the connection reference in your solution from the source environment, and the ConnectionId value from a connection that you first have to manually create on your target environment, and then simply exporting/importing as a managed solution.
In Dev ops the following link shows the required steps:
<grammarly-desktop-integration data-grammarly-shadow-root="true"></grammarly-desktop-integration>