Connection vs Connection Reference - Power Platform Connection Reference Explanation

Connection vs Connection Reference in Power Automate: What is Recommended?

No comments

Loading

In this “Connection vs Connection Reference in Power Automate” article, I will explain what a connection is and what a connection reference is in Power Automate or Power Platform. The often-used terms connectors, connections, and connection references are very much used while we work with Power Automate Flow or Power Apps in the Power Platform. So, let’s get started to understand these concepts, and we will decide whether the connection or connection reference is the preferred approach.

I will explain these Power Platform objects in this sequence. Connector -> Connection -> Connection Reference

What is connector in Power Platform?

If you want to connect your Power Automate action to various data sources like SharePoint, Dataverse, Microsoft Teams, SQL Server, etc., it has to be connected through the connectors, and the user who executes these actions should be authenticated to the data sources. There are over 1200 connectors as of now available from Microsoft; the connectors could be from Microsoft or from third-party vendors. Then connectors could be free (part of the Microsoft licence) or premium (you need to purchase them separately).

Even you can develop your custom connector using the Azure function and use this custom connector in your flow. Examples of Microsoft-based connectors are SharePoint, Microsoft Teams, Office 365 Outlook, SQL Server, etc.

By now, we understand what a connector is in the Power Platform. Now, let’s see this practically.

What is connection in Power Automate?

A connection refers to the set of credentials and permissions that allow a Power Automate flow action to access and interact with data or services in external systems. Connections are used to establish a link between the Power Automate service and various applications, services, or data sources.

When you create a flow in Power Automate (instant, automated, or scheduler flow), you often need to connect to external systems such as SharePoint, Microsoft Teams, Outlook 365, SQL, Twitter, Salesforce, etc. These connections store the necessary authentication details and access tokens required to communicate with those external services securely.

How to create Connection in Power Automate?

Login to your Power Automate environment using this URL: https://make.powerautomate.com/.

Connections in Power Platform
Connections in Power Platform

Click on the “Connections” menu from the left side panel; if you don’t see it, click on the “More” link, then find the “Connections” object and pin it, so that next time you don’t need to come to the depth menu, you can find it from the left side panel main menu itself.

We can see a list of connections in my Power Platform environment; please be aware that these are not connectors; these are connections. For a single connector, there could be multiple connections, so connections could be repeated. For example, if you are connecting to SharePoint Online using “User 1” and “User 2” through the flow actions, in this case there will be two connections to SharePoint Online (one for User 1 and another one for User 2), but the connector is the only one that is SharePoint Online, which is unique. So don’t be confused about this.

Now the question is: how did these connections get created here? The connection can be created two ways: one is when you add any data source action in your flow, like Get Items from SharePoint, Send Email Notification V2 (Office 365 Outlook), etc., and when you successfully authenticate to that connector, your connection will be created here automatically.

Connections repository in the Power Platform
Connections repository in the Power Platform

The other approach is that, from this connections gallery screen, we can see the “+New connection” link, and from here we can also create a new connection.

Create New Connection in Power Automate
Create New Connection in Power Automate

Click on the “”+New connection” link where we can see list of connectors.

Note:

  • These are all connectors that are unique, not connections.
  • As of today, there are around 1200 connectors; this list will increase over time as Microsoft releases new connectors.
Connectors gallery in Power Automate
Connectors gallery in Power Automate

 

Note:

To create a new connection out of the connector, you need to click on the connector name (link) you want to create.

Create New Connection in Power Automate step by step
Create New Connection in Power Automate step by step

Then, click on the “Create” button. For this example, I am creating a SharePoint connection.

Once you click on the “Create” button, it will take you to the connector authentication screen, where you can choose the Microsoft account for this authentication. The account could be yours or that of a colleague (if you know the credentials practically, which is not possible), or even a service account credential (this is recommended for this approach).

Pick an account for connection creation in Power Automate
Pick an account for connection creation in Power Automate

That’s it; your connection will be created and listed in the connections gallery.

 

Note:

  • While you are creating connection references in the Power Platform solution, this step is mandatory, as your connection reference will point to this connection.

Before we dive into the connection reference object in Power Platform, we must know what solution aware flows are and what non solution aware flows are (normal flows).

Connection Vs Connection reference: What are solution aware flows and non-solution aware flows (normal flows) in the Power Platform?

The flows created inside the Power Platform solution are known as solution-aware flows, and on the other hand, flows created outside the solution that are directly inside the environment object are known as non-solution-aware flows. The definition is as simple as it is. Isn’t it?

While we are talking about solution-aware flows, we must know the below points:

  • We can add multiple flows to a single solution. We cannot move non-solution-aware flows (flows not created in a Power Platform solution) into a solution.
  • Non-solution-aware flows (flows not created in a Power Platform solution) cannot participate in the ALM (application lifecycle management) process.
  • Developing a Power Automate flow outside of the solution (non-solution-aware flows) is not recommended. You can develop research- or learning-oriented Power Automate flow in a non-solution aware flow environment; otherwise, for application development, we should create flow in a solution-aware flow (solution-aware flows). We can use connection references in solution-aware flows, which have a lot of advantages over non-solution-aware flows; we will discuss those in the upcoming section.

Non-solution aware flows: Example of connections in Power Automate Flow

Open any of your existing flows. Here I have opened my configure page approval flow in Power Automate from SharePoint Online. You can see the “Connections” section on the right side, where you can see all connections used in the flow, so these are all connections used in the particular flow.

Example of connections in Power Automate Flow
Example of connections in Power Automate Flow

Note:

Non-solution aware flows: Example of my connections in Power Automate Flow

If you want to see “My connections,” you need to click on the three dots of any of the Power Automate actions that have a data source, for example, SharePoint. You can see connections under the “My connections” section, and from here, you can even create a new connection.

Example of my connections in Power Automate Flow
Example of my connections in Power Automate Flow

Note:

  • In non-solution-aware flows, you can create multiple connections for the same action or a different action with your account or with other accounts. Let’s say you have ten actions (with data source) in your Power Automate flow, where you have used your own account for the connection, later on you have changed your password, or you want to configure your flow action with the service accounts.
  • Then your existing flow connection will not work for the password change scenario; you need to re-authenticate all your flow actions one by one, and for the service account configuration, you need to re-create a new connection for each action one by one for your flow. This is a real challenge for the flow maker or administrator. Here is the role of connection reference in your Power Automate flow development.
  • If you use a connection directly to your non-solution-aware flows, and later on if you try to add these types of flows to your solution component, it will create a lot of problems. This is one of the biggest pains while you work with your flows.
  • If you add non-solution-aware flows that use “Connection” into a solution and deploy your solution from the development environment to production environment, then all the flows that use “Connection” will be turned off automatically, but the flows that use “Connection Reference” will be in a turn-on state.

What is connection reference in Power Automate?

As the name implies, it is a reference to connection, which means there is a connection defined and you are referencing that connection in your flow using the connection reference object. We can say this is a proxy call to the actual connection. A connection reference can only be created in a solution, as a connection reference is a solution component that contains information about a connector. The connection reference can be called from solution-aware flows and Power Apps.

Following are a few note-able characteristics of the Power Automate connection reference object:

  • One connection reference object can be used in many flows in solution-aware flows (a maximum of 16 flows as of now; it may change later on).
  • You can import and export your connection reference from one environment to another, like a Development Environment to a Production Environment, without any changes in the configuration.
  • You can edit the connection reference object in the solution itself.
  • If you want to change your connection reference from your account to a service account, you just need to change it in one place; automatically, that connection reference will be updated immediately wherever it is used. Unlike non-solution-aware flows, we don’t need to change it in multiple places. This is the real beauty of the connection reference object in the Power Automate solution.
  • Solution Aware flows can participate in the ALM (application lifecycle management) process, or, in other words, the automatic deployment process, without any manual efforts.

How to create a connection reference in Power Automate?

As we know, a connection reference is a component of a solution, so we need to go to the solutions objects of Power Automate.

From your Power Automate home page, click on the “Solutions” menu from the left side panel. If you don’t find it, click on the “More” link, and you will find it. Pin it for your convenience in the left-side menu panel.

Solutions in Power Platform
Solutions in Power Platform

Then, from the “Solutions” gallery, you need to select your solution where you want to create a “Connection Reference” object. If you don’t have a solution, you can create one by clicking on the “+ New Solution” link.

For this demo, I will open “My Test Solution” to create the “Connection Reference.”.

Connection Reference in Power Platform Solution
Connection Reference in Power Platform Solution

From the “+ New” menu, click on the “More” menu, then click on “Connection Reference.”.

On the connection reference screen, enter the following:

  • Display Name: This is the connection reference display name; you can enter valid, meaningful text. This is a required field.
  • Name: This is the internal name of the connection reference; it’s created automatically once you enter the display name. However, you can change the name as per your business needs. The internal name starts with “new_,” which is fixed and not changeable. After “new_,” you can update your text.
  • Add a description: This is an optional parameter, though it is good to update the description of your connection reference.
  • Connector: This is a mandatory parameter where you need to select your connector from the connector list; for this example, I have selected the “SharePoint” connector.
  • Connection: This is a mandatory parameter where you need to select your connection from the connections list. I have selected my connection, which I created at the beginning; if you have not created your connection at the beginning, you also have the flexibility to create a new connection.
Create new connection reference in Power Platform Solution
Create new connection reference in Power Platform Solution

Click on the “Create” button.

We can see a new connection reference has been created in the “Connection Reference” gallery:

Create Connection Reference in Power Platform Solution
Create Connection Reference in Power Platform Solution

Note:

  • Now this connection reference can be used in your solution-aware flows; consider all your flows using the same connection reference, and then you can use this connection reference in a maximum of 16 flows (as of now, this is the maximum limit; in the upcoming days, Microsoft may increase this limit).

Now, let’s create an automated cloud flow for this testing from the solution.

I have created an automated cloud flow from my “My Test Solution,” where I have just added one SharePoint list trigger and an Office 365 Outlook action.

Then, if we open this flow, we can see a “Connection References” section at the right side panel. In an earlier example, we had a flow (non-solution-aware flow) with “Connections” and not “Connection References.” This is the main difference between the flow created inside the solution and the flow created outside the solution.

Connection References examples in Power Platform Solution
Connection References examples in Power Platform Solution

And if we look closely at the “Connection References” section, we can see that for the “SharePoint” connector, the connection reference we just created, “Test Connection To SharePoint,” is used, and for the Office 365 Outlook connector, we haven’t created any connection references, though the system has created these connection references automatically and they are used in the Office 365 Outlook connector. Let’s get into this concept in more detail.

As I explained, I have the below two setups in my flow: one is a trigger “When an item is created or modified” in SharePoint; another is a send an email (V2) action, which is the Office 365 Outlook connector.

The use of Connection References examples in Power Platform Solution
The use of Connection References examples in Power Platform Solution

Now let’s click on the three dots on these two connectors one by one.

Click on the three dots next to “When an item is created or modified” in SharePoint.

SharePoint Online connection reference example in solution aware flow
SharePoint Online connection reference example in solution aware flow

We can see that the connection reference “Test Connection Reference To SharePoint” that we have created is in a ticked state, which means this connection reference has been used for this SharePoint connector.

Again, let’s click on the three dots next to “Send an email V2” (Office 365 Outlook connector).

Office 365 Outlook connection reference example in solution aware flow
Office 365 Outlook connection reference example in solution aware flow

We can see that the connection reference “Office 365 Outlook MyTestSolution-82d13” that we have not created is in a ticked state, which means this connection reference has been used for this Office 365 Outlook connector. The system created this connection reference automatically, as we didn’t create any connection references for the Office 365 Outlook connector, but we have used the “Send an email (V2)” action in my flow, which belongs to the “Office 365 Outlook” connector.

To justify this statement, let’s now see the number of connection references in the solution.

Office 365 Outlook connection reference created automatically in the Solution
Office 365 Outlook connection reference created automatically in the Solution

In the above screenshot, we can see that the total connection references number is 2, though we just created only one “Test Connection Reference To SharePoint,” and the additional “Office 365 Outlook MyTestSolution-82d13” connection reference was created by the system automatically as there were no connection references for the “Office 365 Outlook” connector, but we have used the “Send an email (V2)” action in my flow.

For your information, let’s open the “Office 365 Outlook MyTestSolution-82d13” connection reference, as shown below:

Office 365 Outlook connection reference is in edit mode
Office 365 Outlook connection reference is in edit mode

Note:

  • Here, you can rename the connection reference display name as per the organization naming convention standard.

From the above discussion, we got to know the following:

  • The connection reference is mapped to a connector.
  • If you don’t have a connection reference in your solution for a certain connector, and if you use any actions from that connector in your solution-aware flow, then your flow will create and use a connection reference automatically for that connector. As we saw in the above example for the Office 365 Outlook connector. You can also try this out; for example, don’t create a connection reference for Microsoft Teams but add an action to create a channel in Microsoft Teams and see what happens.

Diagram of Connection vs Connection Reference in Power Platform

Let’s have a look at the diagram below closely.

Connection Reference vs Connection - Power Platform Connection Reference Explanation
Connection Reference vs Connection – Power Platform Connection Reference Explanation

In the above diagram, I have two connection references, one for SharePoint and the other for Outlook. These two connection references have been used in many solution-aware flows. For example, while you had created the connection references, you had used your own account. Now the requirement has come to replace your account with the service accounts. In this scenario, you just need to update your connection references in one place for SharePoint and another for Outlook.

Then, in all flows or apps, wherever your connection references were used, they will be automatically updated; you don’t have to go to each flow or app to update your connection references one by one. This is the real beauty of connection reference usage. In the above diagram, I have shown just three connection references. Imagine if you have multiple connection references; then you will feel the real benefits of having a connection reference object.

On the other hand, imagine you have flow in non-solution-aware flows (outside the solution); in fact, you have many flows with many different types of actions. In this case, you need to update each connection manually one by one. How difficult is it to manage this type of flow?

Now, let’s answer the question that we started with, “Connection Reference vs. Connection: Who Wins?” After going through this article, you can answer yourself: connection reference or connection which is recommended; definitely connection reference is recommended over the connection, and you know reasons why. Isn’t it?

Summary: Connection Vs Connection Reference in Power Platform

Thus, in this article, we have learned and have a very good understanding of connection vs. connection reference in Power Platform. We also learned practically how to create a connection reference in a Power Platform solution and how to use it in solution-aware flows.

FAQ: Connection Reference in Power Platform

In this section, we will discuss frequently asked questions about connection references in Power Platform.

How to share connection reference in Power Automate?

To share your connection in Power Automate, follow the below steps:

Go to your environment connections gallery.

Click on the three dots next to the connection that you want to share.

Share connection in Power Automate
Share connection in Power Automate

Click on the “Share” link as shown below:

Share Power Automate connection
Share Power Automate connection

Then, in the “Share Approvals” box, enter the service principal or service principal app ids.

Share Approvals in Power Automate connection sharing
Share Approvals in Power Automate connection sharing

Note:

Why is the Power Automate Connection References not showing?

The Power Automate Connection References not showing in the flow action; this may happen if, originally, you developed the flow outside your solution and later added it to the solution, so you might not see the connection references section for your flow actions.

To resolve this issue, we need to do the following:

  • Keep the flow into its own solution.
  • Export as an unmanaged solution.
  • Import the solution again.
  • Then, you will be able to add connection references to the list below.

Here is a detailed explanation from Microsoft about this issue: Use a connection reference in a solution

 

See Also: Power Platform Articles

You may also visit the Power Platform article hub, where you will see a bunch of articles focusing on Power Platform, like Power Automate, Power Apps, etc. All the articles are written with real-time project scenarios and troubleshooting techniques.

 

If you found this article helpful and enjoyed it, please consider sharing it with your friends and colleagues. Please don’t forget to subscribe to our site to receive our latest articles directly in your inbox. 🙂

About Post Author

Do you have a better solution or question on this topic? Please leave a comment