🤖

How to Build a Custom Copilot with Copilot Studio

Jul 8, 2024

How to Build and Publish a Custom Copilot with Copilot Studio and SharePoint Online/OneDrive Integration

Overview

  • Objective: Show how to publish a custom Copilot in Microsoft Teams for consuming SharePoint Online or OneDrive content.
  • Context: Create a chatbot with single sign-on (SSO) capabilities to enhance user experience.

Steps to Configure and Publish Custom Copilot

Initial Setup

  1. Custom Copilot Creation: Using Copilot Studio, create and configure a custom Copilot (e.g., HR Copilot demo).
  2. Goal: Enable the chatbot to access SharePoint Online documents and be available in Microsoft Teams.

Custom Copilot Authentication Setup

  1. Authentication Choices: Choose between manual authentication for SharePoint Online or OneDrive data.
  2. Directory Configuration: Register an application in Azure Entra ID (e.g., HR Copilot demo).
  3. Application Registration: Configure web application authentication using redirect URLs from Copilot Studio.
  4. Client ID Settings: Use the client ID of the registered application in Copilot Studio settings.

Permissions and Authentication Flow

  1. Redirect URL and Tokens: Ensure correct redirect URL and enable access tokens/ID tokens.
  2. Client Secret Creation: Create and copy the client secret into Copilot Studio authentication settings.
  3. API Permissions: Configure Microsoft Graph delegated permissions.
    • Permissions Needed: OpenID, profile, Sites.Read.All, and Files.Read.All.
    • Admin Consent: Grant permissions to ensure no explicit consent is required from end users.

Publishing Custom Copilot in Teams

  1. Initial Publishing: Save settings in Copilot Studio and publish the custom Copilot.
  2. Teams Channel Configuration:
    • Turn on the Teams channel in Copilot Studio.
    • Edit bot details (Icon, Reference Color, Description, etc.).
  3. Advanced Details: Configure developer information and Advanced Details for SSO.
    • App ID: Copy from Copilot Studio and use it in Azure Entra ID under Expose an API.
    • URI and Scope Creation: Configure a custom API and scope (e.g., hr.read).

Azure Entra ID Configuration

  1. Add Client Applications for SSO:
    • Desktop/Mobile Application ID and Web Application ID for Teams.
  2. Authentication Settings:
    • Provide token exchange URL (custom permission scope created earlier).
    • Include additional permission scopes (Sites.Read.All and Files.Read.All).

Final Publishing Steps

  1. Republish Custom Copilot: Make updated configurations available through Copilot Studio.
  2. Availability Options in Teams:
    • Copy link or share with teammates/users.
    • Show to everyone in the organization for broader availability.
    • Upload the .zip file for manual publishing if needed.
  3. Admin Approval and Publishing: Finalize app approval in Teams Admin Center.

User Experience

  1. Without SSO: Users need to log in manually after adding the custom Copilot to Teams.
  2. With SSO: Users are authenticated automatically and can start using the custom Copilot immediately.

Summary

  • Recap of all steps needed to register and publish a custom Copilot with SSO in Teams.
  • Useful links provided for further exploration of the topic.

[Music]