Microsoft 365 automations often start small: someone builds a flow or writes a script, signs in with their own account, and it works. The fragility only shows up months later, usually when that person leaves or the security policy gets tightened. This article is not about what you automate, but about the identity it runs under.
Why your flow stops the day someone leaves
An automation running under a personal account inherits everything from that account: the permissions, but also the restrictions and every change made to it.
- The account gets blocked or deleted. Offboarding disables the account, and the flow attached to it stops without anyone noticing until the first missing report.
- The password changes. Scripts using a stored credential fail silently.
- Conditional access gets stricter. A new policy requiring MFA or a compliant device also hits the background job that has no user sitting behind a screen.
- Permissions are far too broad. An admin account usually has much more access than the automation needs. If the logic goes wrong, so does the blast radius.
- Nobody owns it. The flow lives in the personal environment of someone who no longer works there.
The fix is always the same: give the automation its own identity, its own permissions and a named owner. That also fits the rest of your onboarding and offboarding process in Microsoft 365 and Intune, where disabling an account should have no side effects anywhere else.
Three ways to give an automation its own identity
1. App registration with a certificate
You register an application in Microsoft Entra ID and grant it application permissions on Microsoft Graph. The automation signs in as the application itself, with no user involved. This is called app-only authentication. You then choose between a client secret (a long password) or a certificate. A certificate is the safer route: the private key never has to travel through a log file, an email or a script.
This is the default choice for PowerShell scripts on a server or in a pipeline, and for custom code talking to Microsoft Graph.
2. Managed identity
If your automation runs in Azure, for example as an Azure Function or an Automation runbook, a managed identity is the simplest option. The platform handles sign-in and key rotation, which removes a whole category of mistakes. The limitation is that it only works inside the environments that support it, so not for a script running on a laptop under someone’s desk.
3. A dedicated service account with connections
Power Automate works with connections that belong to a user. For standard connectors that do not support app-only access, a separate licensed account is often still the practical answer. Treat that account as infrastructure: a name that explains its purpose, a registered owner, a password vault and a deliberate conditional access policy. For HTTP calls to Microsoft Graph you can use an app registration from inside a flow; Tom Riha walks through that setup step by step.
Setting up an app registration: the steps
- Register the application in Entra ID. Give it a name that says what it does, such as “Device reporting – read only”.
- Assign application permissions on Microsoft Graph. Note the difference with delegated permissions: application permissions apply across the whole tenant and are not limited by what a user may do.
- Grant admin consent. Without it, sign-in still works but every call fails with a consent error.
- Upload a certificate and keep the private key on the machine that runs the automation, or in a vault.
- Record where the identity is used. One registration per purpose is easier to manage than one large registration for everything.
- Test from a session without your admin rights. That proves the automation runs on its own permissions and is not riding along on your session.
Keep permissions to the minimum
Application permissions are broad. Read access to users means all users, including the leadership team. That makes the choice of permission more consequential than it is for a regular account.
- Always pick the read-only variant if the automation only reads.
- Look up the minimum permission per call in the official Microsoft Graph permissions reference, instead of taking the widest one that “works anyway”.
- Scope the application down where the service allows it, so it cannot reach the entire tenant.
- Document why each permission is there, so cleaning up later is possible.
That last point is not paperwork for its own sake. During an audit or a handover, an app registration with ten unexplained permissions is a problem; one with three justified permissions is not.
Secrets and certificates expire, so build a signal
A common failure with app-only automations is simple: the certificate or client secret expired. Entra ID does not send an alert about this by default, so arrange your own alert.
- Put the expiry date in the owner’s calendar, with a reminder well in advance.
- Better still, let a scheduled job read the validity of your registrations periodically and send a message. There are worked examples of such an alert you can use as a starting point.
- Pick an expiry period that matches your process. A long lifetime is comfortable but raises the risk; a short one forces discipline.
The same approach applies to the reports themselves. The article on sending a monthly device and licence report automatically shows how to build that scheduled job; the identity described here is the missing piece that keeps it running a year later.
Moving an existing flow or script
You want to migrate without the automation going dark for a day.
- Take inventory. Which flows, scripts and scheduled tasks are running, and under whose account?
- Choose a route per item: app registration, managed identity, or service account with a connection.
- Build the new identity alongside the old one. Run both briefly and compare the output.
- Move the flow into a shared environment or solution, so it no longer lives in someone’s personal space.
- Disable the old sign-in and check that nothing breaks.
- Record the owner, the purpose and the expiry date in one place.
Do this before a platform change forces your hand. Microsoft publishes planned changes and deprecations in advance in the Power Platform release plans and in the overview of what is new in Microsoft Graph. The Graph PowerShell SDK is changing too: Microsoft is focusing the modules on PowerShell 7.x and announced in September 2026 a 12-month retirement period for Windows PowerShell 5.x, with v3.0.0 due in Q4 CY2026 and supported only on PowerShell 7.x, as described in the post on the Microsoft 365 Developer Blog and in this summary at Petri. Always check the exact version requirements and dates in the SDK release notes before you plan a migration.
Checklist
- No automation runs under an employee’s personal account.
- Every automation has its own identity: app registration, managed identity or an explicit service account.
- Certificate over client secret wherever possible.
- Only the minimum Graph permissions, each with a documented reason.
- Admin consent granted and recorded.
- Certificate and secret expiry dates are monitored with an alert.
- Flows live in a shared environment, not in a personal workspace.
- Owner, purpose and dependencies are documented.
- You follow the release plans for the platform you depend on.
Want this mapped out for your own tenant? IT consultancy covers exactly this kind of clean-up: finding out what runs where, deciding which identity fits, and moving it over properly. An intro call of half an hour is free.
Frequently asked questions
- What is the difference between delegated and application permissions?
- With delegated permissions the app acts on behalf of a signed-in user, and the effective access is the overlap of what the app and that user may do. With application permissions the app acts without a user and the permission applies tenant-wide, which is why you should scope it far more carefully.
- Certificate or client secret: which should I use?
- A certificate, if your environment supports it. The private key stays on the machine or in a vault and never ends up in scripts or logs. If you do use a client secret, give it a short lifetime and monitor the expiry date.
- Can every Power Automate flow run on an app registration?
- No. Many standard connectors use a connection tied to a user, so those cases need a dedicated service account. For calls to Microsoft Graph you can use an app registration from inside a flow.
- How do I notice when an automation has stopped?
- Only if you arrange it. Have the automation leave a short success signal, such as a message or a log entry, and alert when that signal is missing. Monitor certificate and secret expiry dates separately.


