top of page

Why Run Your Flows Under a Service Account

  • Writer: Sofia Ng
    Sofia Ng
  • Sep 12
  • 2 min read

Business-critical flows should never be executed under a user context.

That might sound blunt, but think about it: if a key process in your organisation relies on someone’s personal account, you’re building fragility into your automation. People leave. Passwords expire. MFA gets enforced. Licenses change. Suddenly, your flow—the one that moves invoices, synchronises data, or triggers customer communications—fails.

By contrast, flows running under a service account (service principal) are stable, scalable, and easier to govern.

Why service principals are essential

  • No dependency on individual staffAccounts don’t disappear when people do.

  • Consistent reliabilityNo interruptions from password changes or MFA prompts.

  • Better handling of request limitsAvoid user-level throttling when workloads scale up.

  • Security and governanceFine-grained permissions and managed secrets give admins control.


Step 1: Create the service account in Azure AD

  1. Go to Azure Active Directory → App registrations → New registration

  2. Name it meaningfully, e.g. Power Automate – Finance Flows

  3. Record:

    • Tenant ID

    • Client ID

    • Client Secret (or upload a certificate)

Assign API permissions (Graph, Dataverse, SharePoint, etc.) and grant Admin Consent.



Step 2: Store the secret in Key Vault

Hardcoding client secrets in a flow is risky. Instead:

  1. In Azure, create a Key Vault and add your service principal’s secret.

  2. In Power Automate, add the Azure Key Vault connector.

  3. Use the Get Secret action. This ensures the flow retrieves the secret securely at runtime.


Step 3: Test the service principal in a flow

Once you have the Tenant ID, Client ID, and the secret from Key Vault, you can test directly inside a flow.

Add an HTTP with Azure AD action. Configure it as:


In the designer, it will look like this:

Action 1: Get Secret (Azure Key Vault)

  • Vault Name: MyFlowSecretsVault

  • Secret Name: PowerAutomate-ClientSecret

Action 2: HTTP with Azure AD


When you run the flow, a successful 200 response with a list of users means the service principal is working.


Best practices

  • Always use Key Vault for secrets.

  • Grant least privilege: only the permissions your flow needs.

  • Document ownership: tie each service account to a business owner and environment.

  • Monitor tenant-level limits: service principals avoid user quotas, but global limits still apply.


Final thought

Running flows under service accounts isn’t just a “best practice”, it’s the difference between fragile automation and enterprise-grade reliability. If a process is business-critical, it deserves the stability and security of a service principal.


Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating

Contact Us

QUESTIONS?

WE'RE HERE TO HELP

  • LinkedIn

© 2023 by Ava Technology Solutions. Proudly created with Wix.com

bottom of page