Skip to content
Tutorials Center
My learning

Topics

Lesson 17 of 38 ยท Connectors and Data

Connections, Authentication and Connection References

Understand connections, whose identity a flow uses, OAuth versus API keys, run-only permissions, service accounts, connection references and what breaks when owners leave.

A connector describes what a flow can do; a connection decides who it does it as. When an action sends an email, the message goes out from the account stored in the connection. Misunderstanding this is the main reason flows break after a reorganization, so it deserves its own lesson.

What a connection is

The first time you use a connector, the designer asks you to sign in or enter a key. The result is a connection: a stored authorization, saved in the environment and listed under Data > Connections. A flow action points at one connection. Many flows can share the same connection.

Connection types by authentication method:

Method How it works Typical use
OAuth 2.0 user sign-in You sign in, a token is stored and refreshed Microsoft 365, Google, Slack
API key A secret string you paste Many SaaS APIs
Basic Username and password Older services
Service principal An app registration with client id and secret or certificate Automation without a person
Windows / gateway Credentials on an on-premises data gateway SQL Server on your network

Whose identity runs the flow?

For cloud flows, every action uses the connection set in the flow, which by default is the creator's. Three common consequences:

  • Mail sent by the flow shows the creator as the sender.
  • Items created in SharePoint show the creator as Created By.
  • The flow sees only what the creator may see. If the creator loses access to a site, the flow fails with a 403.

Instant flows and Power Apps have an extra choice when you share them: Use this connection (creator's) or Provided by run-only user (each user supplies their own). Use the user's own identity when the action must respect their rights (for example reading their calendar), and the creator's when everyone needs the same result (for example posting to a shared channel).

Service accounts

For production flows, avoid personal accounts. Create a dedicated service account (a licensed user such as [email protected] with a strong, rotated password and conditional access suited to automation), and create the connections as that account. Alternatively use a service principal where the connector supports it, or a shared mailbox for emails.

Reasons:

  • Staff turnover does not break the flow.
  • Audit logs show a clear automation identity.
  • Permissions can be restricted to exactly what the flow needs.

Never share a person's password so someone else can maintain a flow. Add that person as a co-owner of the flow instead, and have an administrator create the service account.

Fixing broken connections

When a token expires or a password changes, the connection shows an error and the flow fails with 401 or a message like "The connection is not authorized".

  1. Open Data > Connections.
  2. Find the connection with the red warning and select Fix connection (or Edit). Sign in again.
  3. Resubmit the failed run.

The flow's details page also lists connections used and warns about problems. Some admin policies force a sign-in every few weeks, so keep a calendar reminder for service accounts that use passwords.

Connection references

Solution flows do not store a direct connection. They use a connection reference, a pointer with a name. When you import the solution into another environment you map each reference to a connection that exists there. That is how the same flow can use a test mailbox in test and a real one in production.

Python Stand-in: connection references map names to identities

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Secrets and sensitive data

  • Do not type passwords or keys into a Compose or an HTTP header field in plain text. Anyone who can read the flow definition or run history can see them.
  • Turn on Secure inputs/outputs for actions that handle secrets.
  • Store secrets in Azure Key Vault and read them with the Key Vault connector, or in environment variables of type secret (backed by Key Vault) in solutions.
  • Use Entra ID (OAuth) authentication instead of keys whenever a service supports it.

Auditing connections

A quick review question for every flow: "If this account is disabled tomorrow, which flows stop?" This stand-in groups flows by the connection identity to spot single points of failure.

Python Stand-in: which flows depend on one person?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Common mistakes

  • Building a team process on a personal connection.
  • Reusing a connection across environments by exporting passwords.
  • Not planning for expiry of keys and secrets.
  • Giving a service account more rights than needed ("owner of everything").

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does a connection store?

    A connection holds the stored sign-in or key an action uses to reach a service.
  2. 2. A flow's creator leaves the company and their account is disabled. What happens?

    Actions use the creator's connection by default; it stops working when the account is disabled.
  3. 3. What does a connection reference do in a solution?

    References are names that are mapped to real connections when a solution is imported.
  4. 4. Where should secrets such as API keys preferably be stored?

    Key Vault-backed storage keeps secrets out of flow definitions and run history.

Summary

  • A connection decides who the flow acts as; by default that is its creator.
  • Use service accounts or service principals for production, plus co-owners.
  • Fix expired connections from Data > Connections and resubmit failed runs.
  • Connection references and secure inputs/outputs keep deployments and secrets safe.

Next: SharePoint lists and Excel tables