> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-cloud-runtime-security/cortex-cloud-data-sources-and-connectors/vendor-specific-data-sources/microsoft/microsoft-copilot-studio.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# Microsoft Copilot Studio

Use Microsoft Copilot Studio data for Cortex Cloud.

The capabilities and sub-capabilities listed for this connector are available with any active Cortex XSIAM, Cortex Cloud Runtime, or Cortex Cloud Posture Security license.

This connector includes the following capabilities and sub-capabilities (if applicable):

* Agent Security Scanning
  * `agent-activity-scan`: Agent Activity Monitoring

### How to configure the Microsoft Copilot Studio connector

To access Salesforce Microsoft Copilot Studio, Cortex Cloud requires the following information, which you will specify during the connection process.

* **Global Administrator or Application Administrator** rights in Microsoft Entra ID. This is established using a downladable script in the data connection process.
* **Tenant ID:** The tenant ID associated with your Microsoft Entra ID.
* **Client ID:** The **Application (client) ID** of a registered app in Microsoft Entra ID (formerly Azure AD)
* **Client Secret:** Generate a Client Secret for your registered app on the Microsoft Entra admin center or the Azure portal.

Perform the following procedures in the order that they appear below.

#### Task 1: Identify Your Tenant ID

1. Sign in to the Microsoft Entra admin center or the Azure portal.
2. Browse to **Microsoft Entra ID** (or search for it in the top search bar).
3. Go to **Overview** or **Properties**.
4. Look for the **Tenant ID** box to view and copy your GUID.
5. Copy your tenant details for use later.

#### Task 2: Identify your Client ID

1. Sign in to the Microsoft Entra admin center or the Azure Portal.
2. In the left navigation pane, select **Microsoft Entra ID** (or search for it in the top search bar).
3. Under the **Manage** section on the left, click on **App registrations**.
4. Click on the **All applications** tab to see all registered apps in your tenant.
5. Select your specific application from the list.
6. On the **Overview** page, look for the **Application (client) ID** field. It is represented as a GUID (e.g., `12345678-abcd-1234-efgh-123456789abc`).

#### Task 3: Generate your Client Secret

1. Sign in to the Azure Portal or the Microsoft Entra Admin Center.
2. Search for and select **Microsoft Entra ID** (formerly *Azure Active Directory*).
3. On the left navigation pane, select **App registrations**.
4. Click on the **All applications** tab (if needed) and select your registered application from the list.
5. Under the **Manage** menu on the left, click on **Certificates & secrets**.
6. Select the **Client secrets** tab, then click on **+ New client secret**.
7. In the pane that appears:
   * Enter a short **Description** (e.g., the name of the backend service using it).
   * Select an **Expires** duration (Microsoft recommends 180 days/6 months for security).
8. Click **Add**.

{% hint style="info" %}
**Copy the value in the "Value" column immediately**. Do not copy the *Secret ID*. Once you refresh or navigate away from this screen, the secret value is hidden forever and cannot be retrieved.
{% endhint %}

#### Task 4: Connect Microsoft Copilot Studio to Cortex Cloud

1. In Cortex Cloud navigate to **Settings** → **Data Sources & Integrations**.
2. Click **+ Add new**.
3. In the **Add Data Source** page, search for Salesforce Agentforce.
4. Click **Add Instance** to launch the configuration wizard.
5. Under the **Capabilities** tab, enter an **Instance Name** for your application.
6. Select **Agent Security Scanning,** under **Capabilities**. Click **Next**.
7. Under the **Connection** tab, enter the **Tenant ID**, **Client ID**, and **Client Secret** details.
8. Under **Environment Setup Sript,** download the included script and run it in Azure Power Shell. Detailed instructions to run the script are provided below.
9. Save and run the script and click **Next**.
10. Under Summary, select **Create Instance** to complete the data connection process.

<details>

<summary>Detailed Environment Setup Script Instructions</summary>

Run this script once to give Cortex XSIAM **read-only** access to your Microsoft Copilot Studio (Power Platform) environments.

The script does only three things and nothing else:

* Registers your application with Power Platform so it can list your environments.
* Creates an Application User for your application in each environment (if missing).
* Assigns the **`Service Reader`** role — a **read-only** role — in each environment.

It never reads, modifies, or transmits your Copilot content, and it changes no other user, role, or permission.

**Time required:** a few minutes. Tenants with many environments take longer, because the role is assigned once per environment.

***

### Prerequisites

* The person running the script must be a **Power Platform Administrator** *or* a **Global Administrator** in Microsoft Entra ID. This single tenant-wide role covers everything the script does — including the per-environment work. **You do not need to grant yourself any permission inside individual environments.**

> **No per environment action is needed.** Avoiding manual, per-environment setup is the entire purpose of this script. It discovers your environments and, in each one, creates the Application User and assigns the `Service Reader` role for you — whether you have 5 environments or 200.

***

**Step A — Check / grant the tenant-level admin role**

Prefer **Power Platform Administrator** — it is the least-privilege option that works. **Global Administrator** also works if the account already has it.

**To check what the account already has:**

1. Go to the [Microsoft Entra admin center](https://entra.microsoft.com) and sign in.
2. Select **Users** → find the account that will run the script.
3. Open **Assigned roles**.
4. Look for **Power Platform Administrator** or **Global Administrator**.

**If neither is listed, ask a Global Administrator to grant one:**

1. In the [Microsoft Entra admin center](https://entra.microsoft.com), go to **Roles & admins** → **Roles & admins**.
2. Search for **Power Platform Administrator** and open it.
3. Select **+ Add assignments**.
4. Choose the user, then select **Add**.

> If your organisation uses Privileged Identity Management (PIM), the role may be **eligible** rather than **active**. You must **activate** it before running the script, and finish the run before the activation expires.

**To see which environments will be processed** (optional, for your awareness): go to the [Power Platform admin center](https://admin.powerplatform.microsoft.com) → **Manage** → **Environments**. Every environment listed there with a Dataverse database will be processed. Environments without one are skipped automatically — they cannot host Copilot agents.

***

#### Application settings (Microsoft Entra ID → your scanning app)

Two settings must be configured on the application registration that Cortex will use to scan. Both require a Global Administrator (or an Application Administrator plus consent rights).

**Step B — Add the Dynamics CRM permission**

1. Go to the [Microsoft Entra admin center](https://entra.microsoft.com).
2. Select **Applications** → **App registrations** → open your scanning app.
3. Select **API permissions** → **+ Add a permission**.
4. Choose **Dynamics CRM**.
5. Choose **Delegated permissions**.
6. Tick **`user_impersonation`**, then select **Add permissions**.
7. Select **Grant admin consent for \<your tenant>** and confirm.
8. Check the **Status** column now shows a green **Granted for \<your tenant>**.

> Step 7 is mandatory. Adding the permission without granting consent leaves it inactive and the role-assignment step will fail.

The application does **not** need the Power Platform (BAP) API permission — the script uses a Microsoft-published client for that step.

**Step C — Enable public client flows**

1. In the same app registration, select **Authentication**.
2. Scroll to **Allow public client flows**.
3. Set the toggle to Enable, then select **Save**.

This allows the browser sign-in the script uses. It can be set back to **No** after onboarding, but must be **Yes** again for any future re-run.

#### Information you will need

Both values come from the same app registration page (**App registrations** → your app → **Overview**):

| Value                | Where to find it                       |
| -------------------- | -------------------------------------- |
| **Tenant ID** (GUID) | Overview → **Directory (tenant) ID**   |
| **Client ID** (GUID) | Overview → **Application (client) ID** |

Copy both — you will paste them into the script when prompted.

#### Final checklist — confirm all of these before running

* [ ] **Step A** — the account has **Power Platform Administrator** or **Global Administrator**, and the role is **active** (not just PIM-eligible).
* [ ] **Step B** — `user_impersonation` is added **and** admin consent shows **Granted**.
* [ ] **Step C** — **Allow public client flows** is set to **Yes**.
* [ ] You have the **Tenant ID** and **Client ID** to hand.
* [ ] You can sign in to that account in a browser on the machine running the script.

> Nothing needs to be configured inside individual environments — the script handles that.

#### Network access

The machine must reach:

* `https://login.microsoftonline.com`
* `https://api.bap.microsoft.com`
* `https://*.crm.dynamics.com`

If your network inspects HTTPS traffic (Zscaler, Netskope, etc.), the corporate root certificate must be trusted on the machine — otherwise the script stops with a certificate error.

***

### 2. Choose how to run it

|                                 | **Option A — Launcher**                                 | **Option B — Python directly**                            |
| ------------------------------- | ------------------------------------------------------- | --------------------------------------------------------- |
| Python needed on the machine    | **No**                                                  | **Yes — 3.8 or later**                                    |
| Files to download               | 2                                                       | 1                                                         |
| Also needs `https://github.com` | Yes, only if Python is missing                          | No                                                        |
| Choose this if                  | You do not have Python, or prefer not to use a terminal | You already have Python, or are on a server / Cloud Shell |

Both options perform exactly the same steps.

**To check whether you already have Python:**

```bash
python3 --version     # macOS / Linux
py -3 --version       # Windows
```

Version **3.8 or higher** means you can use either option. Anything else — or "command not found" — use Option A.

***

### 3. Option A — Run with the launcher

**Download both files into the same folder:**

* `onboard_ms_copilot.py`
* `run-windows.bat` (Windows) **or** `run-unix.sh` (macOS / Linux)

Both files must be in the same folder. If only one is downloaded the launcher stops and tells you which file is missing.

#### Windows

Double-click **`run-windows.bat`**, or from a Command Prompt:

```bat
run-windows.bat
```

#### macOS / Linux

```bash
bash run-unix.sh
```

Use `bash run-unix.sh` exactly as shown — this requires no permission changes.

**If Python is not installed**, the launcher downloads a temporary copy into a temp folder, uses it, and deletes it when finished. Nothing is installed, no administrator rights are needed, and an existing Python installation is never modified. These steps are shown with a `[SETUP]` prefix.

Then continue to step 5.

***

### 4. Option B — Run Python directly

**Requires Python 3.8 or later.** If you do not have it, either install it below or use Option A instead, which needs no Python at all.

#### Install Python (only if you do not already have it)

| System                    | How                                                                                                                                                   |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Windows**               | Download from [python.org/downloads](https://www.python.org/downloads/) and run the installer. **Tick "Add python.exe to PATH"** on the first screen. |
| **macOS**                 | Download from [python.org/downloads](https://www.python.org/downloads/) and run the installer.                                                        |
| **Linux (Ubuntu/Debian)** | `sudo apt update && sudo apt install -y python3`                                                                                                      |
| **Linux (RHEL/Fedora)**   | `sudo dnf install -y python3`                                                                                                                         |

Close and reopen your terminal afterwards, then confirm:

```bash
python3 --version     # macOS / Linux
py -3 --version       # Windows
```

You should see `Python 3.8` or higher.

> Installing Python usually requires local administrator rights on the machine. If you do not have them, use Option A — it runs without installing anything.

#### Run the script

**Download one file:** `onboard_ms_copilot.py`

Open a terminal in the folder containing it and run:

```bash
python3 onboard_ms_copilot.py     # macOS / Linux
py -3 onboard_ms_copilot.py       # Windows
```

> **Windows: use `py -3`, not `python`.** On a machine without Python, `python` opens the Microsoft Store instead of running the script.

No packages need to be installed — `pip install` is never required.

***

### 5. Complete the sign-in

1. Enter your **Tenant ID** when prompted.
2. Enter the **Client ID** when prompted.
3. Sign in through the browser as an administrator. **You will be asked to sign in twice** — once to register the application, once to assign the role. This is expected.
4. Wait for:

   ```
   Onboarding complete — app registered and role assigned in all environments.
   ```
5. Return to Cortex and confirm the script has completed.

**Running it again is safe.** Anything already registered or assigned is detected and left unchanged. Re-run it after adding a new environment, so the role exists there too.

> **All environments are included.** The script assigns the role in every environment it discovers. There is no option to include or exclude specific environments — tell your Palo Alto Networks contact before onboarding if only a subset should be scanned.

***

### 6. Troubleshooting

| Message                                                    | What to do                                                                                                                           |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `This tool requires Python 3.8 or later`                   | Install Python 3.8+ from [python.org](https://www.python.org/downloads/), or use Option A.                                           |
| `python: command not found` / `'python' is not recognized` | Use `python3` (macOS/Linux) or `py -3` (Windows).                                                                                    |
| The Microsoft Store opens instead of the script            | You used `python` on Windows. Use `py -3 onboard_ms_copilot.py`.                                                                     |
| `bash: ./run-unix.sh: Permission denied`                   | Run `bash run-unix.sh` instead, or `chmod +x run-unix.sh` first.                                                                     |
| `REQUIRED FILE MISSING: onboard_ms_copilot.py`             | Only the launcher was downloaded. Put both files in the same folder.                                                                 |
| `REQUIRED FILE IS EMPTY` / `onboard_ms_copilot.py.txt`     | The download was incomplete, or the browser renamed the file. Download again and ensure the name is exactly `onboard_ms_copilot.py`. |
| `AADSTS650058`, or a message about **public client flows** | Set **Allow public client flows** to **Yes** on the application, then re-run.                                                        |
| **HTTP 403** during registration                           | The signed-in account is not a Power Platform or Global Administrator.                                                               |
| **HTTP 401**                                               | The sign-in expired. Simply re-run.                                                                                                  |
| Certificate or TLS error                                   | Your network inspects HTTPS. Trust the corporate root certificate on the machine.                                                    |
| `Failed to download portable Python`                       | The connection was interrupted or `github.com` is blocked. Re-run; if it persists, install Python 3.8+ and use Option B.             |
| A role failed in one environment                           | Re-run the script — environments that already succeeded are skipped. If it fails again, send the log file to support.                |

#### Get upport

* If a run fails, a file named `onboard_ms_copilot-<date>-<time>.log` is created **in the same folder as `onboard_ms_copilot.py`**. A successful run creates no log file. Attach that log when contacting Palo Alto Networks support.
* The log records the request URL, HTTP status code, and the error message returned by Microsoft. It does **not** contain passwords, access tokens, or request headers. It does include your Tenant ID and Client ID, which appear in the request URLs — these are identifiers, not secre

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-cloud-runtime-security/cortex-cloud-data-sources-and-connectors/vendor-specific-data-sources/microsoft/microsoft-copilot-studio.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
