> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oleria.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft Power Platform

> Connect Microsoft Power Platform, Power Apps and Power Automate included, to Oleria to discover environments, canvas apps, cloud flows, connections, and custom connectors, the users, groups, and non-human identities that can reach them, and Power Platform audit activity.

Connect Microsoft Power Platform to Oleria to see who and what can reach your Power Apps and Power Automate resources, and how. Oleria reads every environment through the Power Platform admin APIs with a Microsoft Entra app that you register as a Power Platform management application, and adds user and group details from Microsoft Graph. You can review sharing and environment roles, and revoke them from Oleria.

## What Oleria discovers

| Area | Detail |
| :- | :- |
| **Users** | Every Microsoft Entra user who holds Power Platform access: an environment role, or ownership or a share of a canvas app, cloud flow, connection, or custom connector, held directly or through a group. Users assigned one of the Microsoft Entra roles below directly are included too. Guests are marked as external. A share with a user who no longer exists in Microsoft Entra ID appears as a disabled user. Each user has their last Microsoft Entra sign-in, multi-factor authentication (MFA) status, registered authentication methods, and last password change. Global, Power Platform, and Dynamics 365 Administrators and Environment Admins are flagged as administrators. |
| **Non-human identities** | Service principals and managed identities that hold Power Platform access, directly or through a group. |
| **Credentials** | Each connection, as a stored credential, with its status: active when Power Platform reports the connection as connected, disabled when it's in an error state, or unavailable when Power Platform reports neither. An expiry date is shown only when the one Power Platform reports is more than a day away, because on an OAuth connection that date is the access token's lifetime, which Microsoft renews while the connection stays connected. When Oleria shows the account that created the connection, the credential links to it. Who can use a connection comes from its shares. |
| **Groups** | Microsoft Entra groups that hold Power Platform access, with their members and nested groups. Access shared with everyone in your organization appears as an **Entire organization** group that contains every enabled member (non-guest) user. |
| **Roles** | The Microsoft Entra **Global Administrator**, **Power Platform Administrator**, and **Dynamics 365 Administrator** roles, with the users and service principals assigned to them directly, at directory scope. Global Administrators and Power Platform Administrators can manage every environment. A Dynamics 365 Administrator can manage an environment that uses a security group only after being added to that group. Power Platform honors these roles only when they're assigned directly, so this integration doesn't show a group as holding one of them, or flag the group's members as administrators. |
| **Resources and access** | Every environment, with its Environment Admin and Environment Maker role holders in environments without Dataverse. In each environment: canvas apps with their owner and shares, cloud flows with their owner and permissions, connections with their creator and shares, and custom connectors with their shares. |
| **Activity** | Power Apps, Power Automate, data policy, and Power Platform administrator activity from the Microsoft Purview audit log. |

## Prerequisites

* A Microsoft Power Platform tenant in the commercial cloud.
* A **Global Administrator** or **Privileged Role Administrator**, to grant admin consent for Microsoft Graph application permissions. A Cloud Application Administrator or Application Administrator can't grant it.
* A **Global Administrator** or **Power Platform Administrator**, to register the app as a Power Platform management application.
* For activity: audit logging turned on in Microsoft Purview, which needs the **Audit Logs** role in Exchange Online, and in each production environment, which needs the system administrator or system customizer role there.
* Optional: **Microsoft Entra ID P1 or P2**, for last sign-in, MFA status, and authentication methods. Without it, Oleria still syncs, without those details.

## Choose an authentication method

The connection form offers three methods. Pick one:

1. **Authenticate via Microsoft (OAuth)**, the default. You grant admin consent to Oleria's Microsoft app. You don't create your own app registration or manage a credential.
2. **Client Secret Authentication**. You register your own app in Microsoft Entra ID and give Oleria a client secret.
3. **Client Certificate Authentication**. You register your own app and give Oleria a certificate and its private key.

Every method also needs the app [registered as a Power Platform management application](#register-the-app-as-a-power-platform-management-application). That registration gives the app Power Platform Administrator-level access, including with OAuth.

For either manual method, register the app first:

**1. Register an application**

In the [Microsoft Entra admin center](https://entra.microsoft.com), go to **Entra ID** -> **App registrations** -> **New registration**. Name the app (for example, `Oleria Power Platform`) and select **Register**. On its **Overview** page, copy the **Application (client) ID** and **Directory (tenant) ID**.

**2. Create a credential**

> [tab] Client secret
>
> Select **Certificates & secrets** -> **Client secrets** -> **New client secret**, add a description, choose an expiration, and select **Add**. Copy the secret's **Value**. Microsoft never displays it again after you leave the page. A client secret lasts at most 24 months, so update the integration in Oleria before it expires.

> [tab] Client certificate
>
> Select **Certificates & secrets** -> **Certificates** -> **Upload certificate**, choose the public certificate (`.cer`, `.pem`, or `.crt`), and select **Add**. Combine the certificate and its unencrypted private key into one PEM file, then base64-encode the whole file. You paste that base64 string into Oleria's **Client Certificate** field. Update the integration in Oleria before the certificate expires.

**3. Grant API permissions**

Select **API permissions** -> **Add a permission** -> **Microsoft Graph** -> **Application permissions**. Add these permissions and select **Add permissions**:

```
User.Read.All
GroupMember.Read.All
RoleManagement.Read.Directory
```

Then select **Add a permission** again. On the **Microsoft APIs** tab, select **Office 365 Management APIs** -> **Application permissions**, add `ActivityFeed.Read`, and select **Add permissions**.

Optionally, also add these Microsoft Graph application permissions:

* `Application.Read.All`, for the details of service principals with access.
* `AuditLog.Read.All`, for last sign-in, MFA status, and authentication methods. It also needs Microsoft Entra ID P1 or P2.
* `Organization.Read.All`, so Oleria names the connection after your organization instead of your tenant ID, and matches sign-ins on your verified domains.

Finally, select **Grant admin consent for** your tenant.

Oleria can't connect without `User.Read.All`. Without one of the other permissions, Oleria still syncs, with less detail:

| Permission | Without it |
| :- | :- |
| `GroupMember.Read.All` | Groups appear without their members, so users and service principals that reach Power Platform only through a group aren't shown. Revoking access fails for an account that holds no direct access to the resource while a group does, because Oleria can't check its group memberships. When the account does hold direct access, the revoke succeeds, but its result doesn't list access the account keeps through a group. |
| `RoleManagement.Read.Directory` | Holders of the Global, Power Platform, and Dynamics 365 Administrator roles aren't shown. |
| `Application.Read.All` | Service principals appear only with the details Power Platform reports. Revoking access held by a service principal fails, because Oleria can't confirm it isn't removing its own access. |
| `ActivityFeed.Read` | Oleria can't read Power Platform activity. |

## Register the app as a Power Platform management application

Power Platform admin APIs accept an app only after an administrator registers it with Power Platform as a management application. Do this for every authentication method. You can't do it in the Power Platform admin center, and the app can't register itself. An administrator must run the registration while signed in interactively as themselves, not as an app.

> [!WARNING]
>
> The management application registration that Oleria needs has no read-only option. Power Platform treats a registered app like a user with the Power Platform Administrator role, and you can't assign it narrower roles. The app can read and change everything a Power Platform Administrator can. With OAuth, that's Oleria's Microsoft app in your tenant. Oleria changes Power Platform shares and environment roles only when you select **I authorize Oleria to perform write actions in Microsoft Power Platform** in the connection form.

You need the app's **Application (client) ID**:

* **Your own app:** the **Application (client) ID** from its **Overview** page.
* **OAuth:** Oleria's app is added to your tenant when an administrator first grants admin consent to it. Follow [Connect Microsoft Power Platform to Oleria](#connect-microsoft-power-platform-to-oleria) and grant consent first. Oleria then shows a registration error, which is expected at this point. The error includes the app's client ID (see [Troubleshooting](#troubleshooting)). After you register it, select **Authenticate** again.

**1. Install the Power Apps admin PowerShell module**

Sign in as a **Global Administrator** or **Power Platform Administrator**. If you haven't before, sign in to the [Power Platform admin center](https://admin.powerplatform.microsoft.com) once first, because the PowerShell cmdlets fail with an authorization error until you do. Then, in PowerShell, run:

```powershell theme={null}
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
```

**2. Register the app**

Run the following, with your tenant ID and the app's client ID. `Add-PowerAppsAccount` signs you in interactively. With OAuth, find your tenant ID in the [Microsoft Entra admin center](https://entra.microsoft.com) under **Entra ID** -> **Overview** -> **Properties** -> **Tenant ID**.

```powershell theme={null}
Add-PowerAppsAccount -Endpoint prod -TenantID <tenant-id>
New-PowerAppManagementApp -ApplicationId <client-id>
```

If you use the Power Platform CLI instead, the command is `pac admin application register --application-id <client-id>`.

To remove the registration later, for example after you disconnect the integration, run `Remove-PowerAppManagementApp -ApplicationId <client-id>`, or `pac admin application unregister --application-id <client-id>`.

## Turn on audit logging

Oleria reads Power Platform activity from the Microsoft Purview audit log. Microsoft records Power Platform administrator activity by default. Power Apps and Power Automate user activity needs audit logging turned on in Purview and in each environment.

> [!NOTE]
>
> Microsoft Purview captures user activity only for production environments.

**1. Confirm that auditing is on in Microsoft Purview**

Audit logging is on by default for Microsoft 365 organizations, except for Microsoft 365 Business Basic, Business Standard, and Business Premium, and for unmanaged tenants that use free trials of enterprise licenses. To turn it on, sign in to the [Microsoft Purview portal](https://purview.microsoft.com) with the **Audit Logs** role, which the **Compliance Management** and **Organization Management** role groups have. Select the **Audit** solution card, then select the **Start recording user and admin activity** banner. It can take up to 60 minutes to take effect.

**2. Turn on auditing for each production environment**

As a system administrator or system customizer, sign in to the [Power Platform admin center](https://admin.powerplatform.microsoft.com). Select **Security** -> **Compliance**, then the **Auditing** tile. Select the environment, then **Set up auditing** -> **Turn on auditing**.

**3. Send each environment's logs to Purview**

In the Power Platform admin center, select **Manage** -> **Environments**, select the production environment, and select **Settings**. Expand **Product** and select **Privacy and Security**. Under **Storage Shared Access Signature (SAS) Security Settings**, turn on **Enable SAS Logging in Purview**, then select **Save**.

> [!NOTE]
>
> Microsoft asks you to add the `https://*.api.powerplatformusercontent.com` domain to your allow list before you turn on this setting. Otherwise, most Shared Access Signature (SAS) features don't work.

## Connect Microsoft Power Platform to Oleria

**1. Open the integration**

Sign in to your Oleria workspace, go to **Integrations**, and find **Microsoft Power Platform**. Select the **+** icon (**Add Integration for Microsoft Power Platform**), or **Connect** in the list view.

**2. Complete the connection form**

| Field | Notes |
| :- | :- |
| Authentication Method | **Authenticate via Microsoft (OAuth)** (default), **Client Secret Authentication**, or **Client Certificate Authentication**. |
| Tenant Id | Client secret or certificate only. The **Directory (tenant) ID** of your app registration. You can't change it after you connect. |
| Client Id | Client secret or certificate only. The **Application (client) ID** of your app registration. |
| Client Secret | Client secret only. The secret value. |
| Client Certificate | Client certificate only. The base64-encoded PEM file with the certificate and its private key. |
| I authorize Oleria to perform write actions in Microsoft Power Platform (recommended) | Selected by default. Clear it if you don't want Oleria to revoke access. While it's cleared, Oleria refuses revoke actions, but it can still revert earlier ones. You can change it later in the connection settings. |

**3. Authenticate**

Select **Authenticate**. With OAuth, Microsoft asks an administrator to grant consent, then returns you to Oleria. Before it saves the connection, Oleria checks that it can read users from Microsoft Graph and environments from the Power Platform admin API.

## Verify the integration

Confirm that the connection appears on the **Connected** tab of the **Integrations** page with a status of **Healthy**. After the first sync, review users, non-human identities, groups, and environments in your Oleria workspace. The integration's **Capabilities and operation readiness** section lists the permissions each capability needs. Power Platform access appears there as **Power Platform management application registration**. The first activity can take up to 12 hours to appear, because Microsoft starts delivering audit records up to 12 hours after Oleria subscribes to them. If the first sync fails, check that the app is still registered as a Power Platform management application in the tenant you connected. A missing registration stops the sync.

## Remediation actions

Oleria offers **Revoke permission to resource instance** when **I authorize Oleria to perform write actions in Microsoft Power Platform** is selected. It needs the management application registration. Revoking a service principal's access also needs the optional `Application.Read.All` permission.

| Target | What Oleria does | Revert |
| :- | :- | :- |
| Canvas app, cloud flow, connection, or custom connector | Removes the share that a user, group, or service principal holds directly on it. On the **Entire organization** group, removes the share with everyone in your organization. | Adds the same share back. If the principal holds a different role on it by then, the revert fails and changes nothing. |
| Environment without Dataverse | Removes the Environment Admin and Environment Maker roles that a user, group, or service principal holds directly. | Adds the removed roles back. If the principal has been given an environment role that the revoke didn't remove, the revert fails and changes nothing. |

Oleria refuses to revoke:

* The owner of a canvas app, cloud flow, connection, or custom connector. Microsoft documents these ways to change an owner:
  * **Canvas app:** an administrator runs `Set-AdminPowerAppOwner`. The previous owner keeps view access.
  * **Cloud flow:** only a solution-aware flow's owner can be changed, in Power Automate. The previous and new owners both become co-owners.
  * **Connection:** its owner can only be removed by deleting the connection.
  * **Custom connector:** Microsoft documents no way to change its owner.
* Environment roles in an environment with Dataverse. Its roles are Dataverse security roles, which the [Microsoft Dynamics 365](https://docs.oleria.com/integrations/dynamics365.md) integration manages.
* Access that an account has only through a group, or only through a share with everyone in your organization. The error gives the group's object ID and role, or **Entire organization**. Remove the account from the group, or remove that share in Power Platform.
* The Oleria app's own access.
* Access that includes a role Oleria couldn't add back on revert. The error names the role, and Oleria removes nothing. Remove that access in Power Platform.

If the account holds no access to the resource at all, the action succeeds and changes nothing. If Oleria removes the account's direct access but the account still has access through a group or a share with everyone in your organization, the action succeeds and its result lists that remaining access. If Oleria can't check the account's group memberships, for example without `GroupMember.Read.All`, the action still succeeds, and its result doesn't list access through a group.

## Known limitations

* **Commercial cloud only.** Oleria reads only the commercial-cloud Power Platform APIs, so tenants in the US Government (GCC, GCC High, DoD) and China clouds aren't supported.
* **Model-driven apps aren't inventoried** by this integration or the [Microsoft Dynamics 365](https://docs.oleria.com/integrations/dynamics365.md) integration. Their access is governed by Dataverse security roles, which the Microsoft Dynamics 365 integration collects for the environment it's connected to. To see those roles, connect each Dataverse environment to the Microsoft Dynamics 365 integration. For the same reason, Oleria reads environment roles only in environments without Dataverse.
* **Only custom connectors are collected.** Microsoft's own connectors aren't shown as resources.
* **A refused request skips only that part of an environment.** If Power Platform rejects or denies the request for an environment's roles, canvas apps, connections, or custom connectors, Oleria skips them for that sync and continues. If it rejects the request for one app's, connection's, or custom connector's sharing, Oleria skips only that item. If Power Platform denies the request to list canvas apps, connections, or custom connectors in every environment, the sync fails, because that means the management application registration was removed. A denied request for one item's sharing, or for an environment's roles, doesn't count toward this, because Power Platform denies role requests for environments with Dataverse. A timeout, throttling, or a list that stops partway through also fails the sync.
* **Cloud flows come from an API Microsoft doesn't support.** If Microsoft's flow admin API rejects the request for an environment's flows, or answers in a form Oleria can't read, Oleria skips them for that sync. If it can't read one flow's permissions, Oleria skips that flow. A timeout, throttling, or a server error fails the sync instead.
* **Last activity is the last Microsoft Entra sign-in**, not the last use of Power Platform. It needs `AuditLog.Read.All` and Microsoft Entra ID P1 or P2.
* **Activity looks back up to 7 days** on the first sync. After that, Oleria reads new events with a two-hour delay.
* **Groups with hidden membership** appear without members. Reading them needs `Member.Read.Hidden`, which Oleria doesn't request.
* **Eligible role assignments aren't shown.** Oleria reads active, directory-wide assignments of the Global, Power Platform, and Dynamics 365 Administrator roles, not Privileged Identity Management (PIM) eligibilities.
* **Not synced:** Copilot Studio agents, Power Platform licenses, desktop flows, gateways, Power Pages, and data policies.
* **Disabling non-human identities** isn't offered from this integration.

## Troubleshooting

When Oleria can't connect, it shows **Error creating integration**, followed by `received invalid inputs. actual error:` and one of these messages:

| Message | Fix |
| :- | :- |
| `Microsoft Graph refused the app (status <status> <code>): grant the application permission User.Read.All with admin consent` | Add the `User.Read.All` application permission and select **Grant admin consent for** your tenant. |
| `The app is not registered as a Power Platform management application: a Power Platform administrator must register the app (client ID <client ID>) ...` or `Power Platform refused the app: a Power Platform administrator must register the app (client ID <client ID>) ...` | Register the client ID in the message as a management application, as in [Register the app as a Power Platform management application](#register-the-app-as-a-power-platform-management-application). Then select **Authenticate** again. |
| `Power Platform refused the app (status <status> <code>) although it is registered as a management application; check that the registration is in this tenant and try again in a few minutes`, or the same message with `(Power Platform listed no default environment)` | Confirm that the registration was made in the same tenant you're connecting. Wait a few minutes, then select **Authenticate** again. |
| `a valid Directory (tenant) ID is required` | Enter the **Directory (tenant) ID** from your app registration's **Overview** page. |

## Contact us

For questions about this integration, contact us at [support@oleria.com](mailto:support@oleria.com).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.