Connection vs connection reference - Power Platform [#shorts]

What you must know?

Connection in Power Platform allows you to connect Power Automate flow / Power Apps application or anything else in Power Platform to a particular system / data source or application. Connections are mainly created when you work with Power Platform components. For example, when you work with Power Automate cloud flow and want to connect to the SQL Server database.

Connection reference is a reference for a connection created in Power Platform. Connection reference stores information about a connection. After you have a connection made, you can create a connection reference. Remember that the connection reference only works within a solution and can’t be used in components outside it. The primary purpose of connection reference is to establish a connection to the system component after a solution is migrated into a different environment. It is very beneficial, so you don’t need to recreate all connections again after the migration.

Let’s see what Microsoft says about the connection references:

A connection reference is a solution component that contains information about a connector. Both the canvas app and operations within a Power Automate flow bind to a connection reference. You can import your connection reference into a target environment with no further configuration needed after the import completes. To change a specific connection associated with a canvas app or flow, you edit the connection reference component within the solution.

What is the difference?

The main difference between a connection and a connection reference is that a connection reference is used within a solution and can be migrated with the solution, so there is no need to create all connections for a solution again after the solution is imported. On the other hand, a connection can’t be migrated; you can’t even add a connection to the solution. So, to take your connection to a different environment, you use connection references that store the required information about a connection.

There is an excellent Microsoft article about connection references. You can find it here:

Remember also that you can’t create a connection reference without a connection.

How to create a connection reference?

To create a connection reference, you must first create a connection. You can make a connection from an application or a flow. You can also create a connection from the “Connections” tab in Power Apps. This is what I am going to do now.

I have created a connection to the SharePoint site.

Now, if an app uses SharePoint site as a data source, for example, I would create a connection reference for this connection, so later I can move this connection with a solution.

To create a connection reference, go to the solution and click “+ New,” and then choose “Connection reference.”

Now, provide a details of a connection reference based on a connection.

Your connection reference will be added to the solution. Now you can use it in apps, and flows and migrate it with a solution.

How to use a connection reference

Power Automate

To use a connection reference in a Power Automate cloud flow, just add a flow to the solution (or create a flow inside of a solution) and choose a connection reference in the action. As shown down below.

Remember that connection reference can be used only for cloud flows included in a solution!

Power Apps

As for Power Apps, you won’t see “Connection references” tab. As Microsoft says:

A connection reference is automatically created when you create new connections from the flow and canvas app designers.
Canvas apps and flows added from outside solutions will not automatically be upgraded to use connection references.

So, after you have created a connection to the data source, a connection reference will be used instead of a connection. Remember that it works only for applications inside of a solution! 

Summary

In summary, use connection references when you work with a solution. Work with connections when you create a standalone application/flow that won’t be included in a solution. Remember that if you don’t have a connection reference in your solution, you will be forced to recreate all connections after a migration. With connection references, no additional work is required.

So, finally, we are at this point where I should thank you for your time and for reading this article. Feel free to rate this article and comment if you liked it. If you have any questions, feel free to contact me (via contact@poweruniverse.org), but first, you may be interested in joining a Newsletter. Hmm? (Sign up here) If you already did, wow, thanks, thanks a lot 🙂 

Via Newsletter, I am sharing insights into my work, plans for upcoming weeks, and knowledge about Power Platform Universe and the IT world. If you are interested, feel free to join! I am going to send the latest Newsletter to everyone who enters!

See you!

About the author

Daniel Ciećkiewicz

FOUNDER

I am a Senior Power Platform Consultant focused on Dataverse, Power Apps, and Power Automate. I was also a Team Leader responsible for the Power Platform Team and their development paths. 

In my private life, I like video games, sports, learning & gaining knowledge, and a taste of good Scotch Whisky! 

Ooo, I almost forgot, I love our Polish Tatra Mountains!

Categories
Top 3 articles
Newest articles
These May also interest you:
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x