--- title: "Configuring Microsoft Copilot Studio" slug: "configuring-microsoft-copilot-studio" updated: 2026-12-02T16:58:55Z published: 2026-12-02T16:58:55Z canonical: "docs.plainid.io/configuring-microsoft-copilot-studio" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.plainid.io/llms.txt > Use this file to discover all available pages before exploring further. # Configuring Microsoft Copilot Studio This page walks through deploying the Microsoft Copilot Studio Authorizer in your Azure subscription and connecting it to Copilot Studio, including: - Preparing your PlainID values - Choosing the endpoint and pushing the image - Deploying the Authorizer to Azure Container Apps - Registering the Authorizer in Microsoft Entra ID - Turning on the Authorizer in the Power Platform admin center - Testing and moving to enforcement You deploy one Authorizer per Microsoft Entra tenant. After deployment, you change settings through the container app's environment variables, without changing your agents. ## Prerequisites Before you start, ensure you have: - An Azure subscription, and permission to create resource groups and resources in it, for example the Contributor role. - Permission to create app registrations in your Microsoft Entra tenant, for example the Application Administrator role. - A domain you own, and access to its DNS records. You verify the domain in Microsoft Entra ID in Step 2. - A Power Platform administrator for the environment you want to protect. - Copilot Studio agents that use generative orchestration. Copilot Studio calls the Authorizer only for these agents. - A PlainID Environment with access to the PDP (Runtime) endpoint. - A Scope in PlainID with a Client ID and Client Secret. See [Managing Scopes](/v1/docs/managing-scopes) for more information. - A machine with Docker, the Azure CLI (signed in with `az login`), and Python 3. - The Copilot Studio Authorizer package. The package contains: | File | Purpose | | --- | --- | | `image/plainid-copilot-authz-<version>-linux-amd64.tar` | The Authorizer container image, as a `docker load` archive, and its `SHA256SUMS` checksum file. | | `config/authorizer.env.example` | Every setting, ready for you to fill in. | | `scripts/push-image.sh` | Pushes the image to your Azure Container Registry (Step 3). | | `scripts/deploy-container-app.sh` | A command line alternative to Step 4. | | `scripts/federated-credential-subject.py` | Computes the federated credential subject (Step 6). | ### Values You Collect You collect these values as you go and use them in later steps: | Value | Description | Where you get it | | --- | --- | --- | | `PLAINID_PDP_URL` | Your PlainID Runtime address, for example `https://<tenant>.plainid.io/api/runtime`. | Step 1 | | `PLAINID_CLIENT_ID` | The Client ID of your PlainID Scope. | Step 1 | | `PLAINID_CLIENT_SECRET` | The Client Secret of your PlainID Scope. Treat it as a secret. | Step 1 | | Endpoint | The Authorizer's address on your domain, for example `https://authz.yourcompany.com`. | Step 2 | | Image | `plainid-copilot-authz:<version>`, pushed to your Azure Container Registry. | Step 3 | | `ENTRA_TENANT_ID` | Your Microsoft Entra Directory (tenant) ID. | Step 6 | | `ENTRA_APP_ID` | The Application (client) ID of the Authorizer's app registration. | Step 6 | ## Step 1: Prepare PlainID 1. In PlainID, create or choose the Scope that decides Copilot Studio tool calls. See [Managing Scopes](/v1/docs/managing-scopes) for more information. 2. Record the PDP URL, the Client ID, and the Client Secret. 3. Confirm that the Scope includes the two identity types the Authorizer sends: | Identity | Default identity type ID | What the Authorizer sends | | --- | --- | --- | | Users | `User` | The user's Microsoft Entra object ID. | | Agents | `Internal_AI_Agent_Registry` | The agent's Microsoft Entra Agent ID, as an additional identity. | 1. Model your tools as Assets of the `MCP-TOOL` Asset Type. Each Asset's path is the tool's own name, without the prefix Copilot Studio adds. For example, an MCP tool that Copilot Studio shows as `Acme-Bank-MCP-get_balance` has the path `get_balance`, and knowledge search has the path `UniversalSearchTool`. See [MCP and Tools](/v1/docs/mcp-policy-builder-controls) for more information. You can continue before your Policies are ready. In Observe and Discover modes, the Authorizer permits every call, and Discover mode lists the exact agent and tool names for you (Step 9). ## Step 2: Choose the Endpoint and Verify Your Domain Copilot Studio calls the Authorizer at an HTTPS address on a domain that your Microsoft Entra tenant has verified. 1. Choose the address, for example `https://authz.yourcompany.com`. 2. If your Microsoft Entra tenant hasn't verified the domain (`yourcompany.com`) yet, go to the Microsoft Entra admin center, then **Settings** > **Domain names** > **Add custom domain**. Add the TXT record it shows at your DNS provider, then select **Verify**. Important Use the endpoint exactly the same way, without a trailing `/`, in Steps 4, 5, 6, and 8. If the address differs in any step, the Power Platform admin center can't save the connection. See Microsoft's [Add your custom domain name to your tenant](https://learn.microsoft.com/en-us/entra/fundamentals/add-custom-domain) for more information. ## Step 3: Create a Container Registry and Push the Image 1. Sign in to the Azure portal. 2. Go to **Resource groups** > **Create**. Select the subscription, enter a name (for example `rg-plainid-authorizer`), choose the Region closest to your Power Platform environment, then select **Review + create** > **Create**. 3. Go to **Container registries** > **Create**. Use the same resource group and Region, enter a registry name (for example `contosoacr`), select the **Basic** pricing plan, then select **Review + create** > **Create**. 4. Open the registry, go to **Access keys**, and turn on **Admin user**. Azure Container Apps uses it to pull the image. 5. From the package folder, run the command below. The script checks the image file, loads it, and pushes `contosoacr.azurecr.io/plainid-copilot-authz:<version>`. ``` bash scripts/push-image.sh contosoacr ``` See Microsoft's [Manage resource groups in the Azure portal](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/manage-resource-groups-portal) and [Create a container registry in the Azure portal](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal) for more information. ## Step 4: Deploy the Authorizer to Azure Container Apps You can deploy from the Azure portal or from the command line. ### Deploying from the Azure Portal **To deploy from the Azure portal:** 1. Go to **Container Apps** > **Create**. 2. On **Basics**, select the resource group from Step 3, enter a name (for example `plainid-copilot-authz`), select the same Region, and create a new Container Apps environment on the Consumption plan. 3. On **Container**, clear **Use quickstart image**, then set: - **Image source**: **Azure Container Registry**. Select your registry from Step 3, the image `plainid-copilot-authz`, the image tag of your release, and authentication with the admin credentials. - **CPU and memory**: 0.5 vCPU, 1 Gi. - **Environment variables**: add the variables in the table below. Store the PlainID Client Secret as a secret first, then reference it. After creation, you manage secrets on the app's **Secrets** page. | Name | Value | | --- | --- | | `MODE` | `capture` | | `ENTRA_TENANT_ID` | Your Microsoft Entra Directory (tenant) ID. The app registration's **Overview** page shows it (Step 6). | | `ENTRA_APP_ID_URI` | Your endpoint, for example `https://authz.yourcompany.com`. | | `PLAINID_PDP_URL` | From Step 1. | | `PLAINID_CLIENT_ID` | From Step 1. | | `PLAINID_CLIENT_SECRET` | **Reference a secret** > `plainid-client-secret`. | 1. On **Ingress**, select **Enabled**, **Accepting traffic from anywhere**, **HTTP**, and target port `8000`. 2. Select **Review + create** > **Create**. 3. Open the app, go to **Scale**, set **Min replicas** and **Max replicas** to `1`, and select **Save**. With one replica always running, the Authorizer stays warm and answers immediately. 4. In a browser, open the app's **Application Url** followed by `/healthz`. The response shows `"status"`, the current mode, and any setting you still need to configure under `"problems"`. ### Deploying from the Command Line 1. Copy `config/authorizer.env.example` to `config/authorizer.env` and fill it in. Leave `ENTRA_APP_ID` empty for now; you set it in Step 7. 2. Run: ``` bash scripts/deploy-container-app.sh rg-plainid-authorizer contosoacr ``` The script creates the Container Apps environment and the app with the same configuration as the portal steps: one replica, port `8000`, and the PlainID Client Secret stored as a secret. Run the script again after every change to `config/authorizer.env`. See Microsoft's [Create a container app in the Azure portal](https://learn.microsoft.com/en-us/azure/container-apps/quickstart-portal) and [Manage secrets in Azure Container Apps](https://learn.microsoft.com/en-us/azure/container-apps/manage-secrets) for more information. ## Step 5: Bind Your Endpoint and a Managed Certificate 1. In the container app, go to **Custom domains** > **Add custom domain** > **Managed certificate**. 2. Enter the host name from Step 2, for example `authz.yourcompany.com`. The portal shows two DNS records. Add both at your DNS provider: | Type | Name | Value | | --- | --- | --- | | CNAME | `authz` | The app's default domain, as the portal shows it. | | TXT | `asuid.authz` | The domain verification code, as the portal shows it. | 1. Select **Validate** > **Add**. Azure issues the certificate and renews it for you. 2. Confirm that `https://authz.yourcompany.com/healthz` opens over HTTPS. See Microsoft's [Custom domain names and free managed certificates in Azure Container Apps](https://learn.microsoft.com/en-us/azure/container-apps/custom-domains-managed-certificates) for more information. ## Step 6: Register the Authorizer in Microsoft Entra ID Copilot Studio gets a token for the Authorizer through an app registration in your tenant. A federated credential lets Microsoft's Copilot Studio service get that token, so you never create or store a client secret. 1. In the Microsoft Entra admin center, go to **App registrations** > **New registration**. - **Name**: `PlainID Copilot Studio Authorizer`. - Keep **Accounts in this organizational directory only**. - Leave the redirect URI empty. - Select **Register**. 2. On **Overview**, record the **Application (client) ID** as `ENTRA_APP_ID` and the **Directory (tenant) ID** as `ENTRA_TENANT_ID`. 3. Go to **Expose an API** > **Application ID URI** > **Add**, enter your endpoint exactly (for example `https://authz.yourcompany.com`), and select **Save**. 4. Go to **Certificates & secrets** > **Federated credentials** > **Add credential**, and enter: | Field | Value | | --- | --- | | **Federated credential scenario** | **Other issuer** | | **Issuer** | `https://login.microsoftonline.com/<tenant-id>/v2.0` | | **Type** | **Explicit subject identifier** | | **Value** | The subject you compute below. | | **Name** | `copilot-studio-threat-detection` | | **Audience** | `api://AzureADTokenExchange` | The subject identifies your tenant, Microsoft's Copilot Studio service (`9d8f559b-5984-46a4-902a-ad4271e83efa`), and your endpoint. Compute it with the script in the package: ``` python3 scripts/federated-credential-subject.py https://authz.yourcompany.com ``` Or run this snippet (Python 3, no packages required): ``` import base64, uuid tenant = "" endpoint = "https://authz.yourcompany.com" copilot = "9d8f559b-5984-46a4-902a-ad4271e83efa" # Microsoft Copilot Studio service b64 = lambda raw: base64.urlsafe_b64encode(raw).rstrip(b"=").decode() print("/eid1/c/pub/t/%s/a/%s/%s" % (b64(uuid.UUID(tenant).bytes_le), b64(uuid.UUID(copilot).bytes_le), b64(endpoint.rstrip("/").encode()))) ``` The app registration needs no API permissions, no admin consent, and no client secret. See Microsoft's [Enable external threat detection for Copilot Studio](https://learn.microsoft.com/en-us/microsoft-copilot-studio/external-security-provider) and [Configure a federated identity credential](https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation-create-trust) for more information. ## Step 7: Connect the Authorizer to the App Registration 1. In the container app, go to **Containers** > **Edit and deploy**, select the container, and open **Environment variables**. Add `ENTRA_APP_ID` with the Application (client) ID from Step 6, then select **Save** > **Create**. From the command line, set `ENTRA_APP_ID` in `config/authorizer.env` and run `scripts/deploy-container-app.sh` again. 2. Open `https://authz.yourcompany.com/healthz`. Expect `"status": "ok"`, your app ID under `"appId"`, and under `"problems"` only the note that the Authorizer runs in Observe mode. ## Step 8: Turn On the Authorizer in the Power Platform Admin Center 1. Open the Power Platform admin center and go to **Security** > **Threat detection** > **Additional threat detection**. 2. Select the environment, then select **Set up**. 3. Turn on **Allow Copilot Studio to share data with a threat detection provider**. 4. In **Azure Entra App ID**, enter the Application (client) ID from Step 6. 5. In **Endpoint link**, enter your endpoint exactly as in Step 6, for example `https://authz.yourcompany.com`. 6. Set **Error behavior** to **Block**, so Copilot Studio runs a tool only after the Authorizer permits the call. 7. Select **Save**. The admin center validates its connection to the Authorizer. See Microsoft's [Enable external threat detection for Copilot Studio](https://learn.microsoft.com/en-us/microsoft-copilot-studio/external-security-provider) for more information. ## Step 9: Test and Move to Enforcement You move between modes by changing `MODE` on the container app (**Containers** > **Edit and deploy**, as in Step 7). See [Authorizer Modes](/v1/docs/microsoft-copilot-studio#authorizer-modes) for what each mode does. 1. In Copilot Studio, open an agent that uses generative orchestration in the **Test** pane, and ask something that uses a tool. 2. Open `https://authz.yourcompany.com/healthz`. Under `"stats"`, the response shows the latest request, with its agent, user, tool, and decision. 3. To build your inventory of agents, users, and tools in PlainID, set `MODE` to `discovery`. This mode requires the reporting settings. See [Reporting to PlainID](/docs/configuring-microsoft-copilot-studio#reporting-to-plainid). 4. When your Policies are ready, set `MODE` to `enforce`. ### Verifying from the Command Line You can also check the setup with these optional commands: ``` # 1. The Authorizer is up, on your endpoint, with your settings curl https://authz.yourcompany.com/healthz # 2. Without a Copilot Studio token, the Authorizer refuses the call (expected: 401) curl -s -o /dev/null -w "%{http_code}\n" -X POST https://authz.yourcompany.com/validate ``` ## Reporting to PlainID When it reports to PlainID, the Authorizer sends each agent, user, and tool it sees, so the Platform discovers new agents and tools as they start making requests. Reporting requires your PlainID Collector URL and a POP client certificate and key. To get them, create a Gateway Integration POP with **Other Gateway** as the Gateway Vendor. If you select the **Key Leaf** certificate type, the POP gives you the certificate and key as separate PEM files, and you can skip the conversion in step 1 below. See [Gateway Integration POP Setup](https://docs.plainid.io/docs/gateway-integration-pop-setup). | Setting | Default | Description | | --- | --- | --- | | `DISCOVERY_REPORTING` | `auto` | `auto` reports only while `MODE` is `discovery`. `true` also reports while `MODE` is `enforce`. `false` never reports. | | `COLLECTOR_URL` | Empty | Your PlainID Collector address, from PlainID. | | `COLLECTOR_CERT_FILE` | Empty | Your POP client certificate, as a PEM file in the container, for example `/certs/pop-cert.pem`. | | `COLLECTOR_KEY_FILE` | Empty | The certificate's private key, as a PEM file in the container, for example `/certs/pop-key.pem`. | **To add the POP certificate:** 1. Convert the `.pfx` file you received from PlainID into two PEM files: ``` openssl pkcs12 -in pop.pfx -clcerts -nokeys -out pop-cert.pem openssl pkcs12 -in pop.pfx -nocerts -nodes -out pop-key.pem ``` 1. Add each PEM file as a container app secret. 2. Go to **Containers** > **Edit and deploy** > **Volumes**, and mount both secrets as a **Secret** volume at `/certs`. 3. Set `COLLECTOR_URL`, `COLLECTOR_CERT_FILE`, and `COLLECTOR_KEY_FILE`. ## Configuration Reference Every setting is an environment variable on the container app. Only the settings in the first table are required. ### Required Settings | Setting | Description | | --- | --- | | `MODE` | The Authorizer mode: `capture` (Observe), `discovery` (Discover), or `enforce` (PlainID decides every call). | | `ENTRA_TENANT_ID` | Your Microsoft Entra tenant. The Authorizer accepts only tokens from this tenant. | | `ENTRA_APP_ID` | Your app registration from Step 6. The Authorizer accepts only tokens issued for it. | | `ENTRA_APP_ID_URI` | Your endpoint, which is also the app registration's Application ID URI. The Authorizer expects it as the token audience. | | `PLAINID_PDP_URL` | The PlainID Runtime that makes the decisions. | | `PLAINID_CLIENT_ID` | The Client ID of the PlainID Scope that makes the decisions. | | `PLAINID_CLIENT_SECRET` | The Scope's Client Secret. Store it as a container app secret. | ### Identity Settings These settings control which identities PlainID receives. | Setting | Default | Description | | --- | --- | --- | | `ENTITY_TYPE_ID` | `User` | The identity type ID of users in your PlainID Scope. | | `AGENT_ENTITY_TYPE_ID` | `Internal_AI_Agent_Registry` | The identity type ID of agents in your PlainID Scope. | | `AGENT_IDENTITY` | `true` | `true` sends the agent as an additional identity, so your Policies can evaluate the user and the agent together. | | `AGENT_ID_SOURCE` | `entra` | Which agent ID the Authorizer sends: `entra` sends the agent's Microsoft Entra Agent ID, and `bot` sends the Copilot Studio agent ID. | | `IDENTITY_MODE` | `entity` | `entity` sends the user and agent IDs in the request. `jwt` sends a short-lived signed token that carries the user and the agent, which you can verify at `/.well-known/jwks.json`. | ### Decision Settings | Setting | Default | Description | | --- | --- | --- | | `TOOLS_RESOURCE_TYPE` | `MCP-TOOL` | The PlainID Asset Type of the tools. | | `ON_PDP_ERROR` | `deny` | The decision the Authorizer returns when it can't reach PlainID or PlainID returns an error. | | `BLOCK_REASON` | `Blocked by PlainID: {tool} is not allowed for this user.` | The message the user sees in the chat when the PDP denies a call. | ### Logging Settings | Setting | Default | Description | | --- | --- | --- | | `CAPTURE` | `tool_call` | Which requests the Authorizer keeps a copy of for audit: `tool_call`, `all`, or `none`. | PlainID tunes the defaults of all other settings for production. Change them only with your PlainID contact. ## Rotating the Client Secret Rotate the PlainID Client Secret according to your normal policy: 1. Update the secret on the container app's **Secrets** page. 2. Go to **Revisions and replicas** and select **Restart**. ## Troubleshooting | What you see | Likely cause | What to do | | --- | --- | --- | | Microsoft Entra ID refuses the Application ID URI (`HostNameNotOnVerifiedDomain`). | Your tenant hasn't verified the endpoint's domain. | Complete Step 2. | | The Power Platform admin center can't save the connection. | `ENTRA_APP_ID` isn't set, or the endpoint differs between Steps 5, 6, and 8. | Complete Step 7, and use the identical address, without a trailing `/`, everywhere. | | `/healthz` lists items under `"problems"`. | A setting is missing or hasn't taken effect yet. | Each item names the setting to fix. | | No requests appear for an agent. | The agent doesn't use generative orchestration, or you haven't set up the environment. | Use an agent with generative orchestration, and check Step 8. | | Copilot Studio denies calls with "PlainID could not decide". | PlainID returned an error for the request. | Check the Client ID and Client Secret, the identity type IDs, and that the tool exists as an Asset of the `MCP-TOOL` Asset Type. | ## Security Recommendations - Store `PLAINID_CLIENT_SECRET` and the POP certificate only as container app secrets, never in plain settings or support tickets. - The app registration has no secret and no permissions. Copilot Studio authenticates only through the federated credential. - Keep **Min replicas** and **Max replicas** at `1`, and keep HTTPS only, which Azure Container Apps ingress uses by default. - Keep the admin center's **Error behavior** on **Block** in production.