Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
# https://github.com/blog/2392-introducing-code-owners
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

* @adilei @HenryJammes
* @adilei @HenryJammes

# ESS team owns their own content
/EmployeeSelfServiceAgent/ @microsoft/ess-contributors
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Older samples and labs, largely focused on Power Virtual Agents, have been moved
| Guidance documentation | [aka.ms/CopilotStudioGuidance](https://aka.ms/CopilotStudioGuidance) |
| Try Copilot Studio | [aka.ms/TryCopilotStudio](https://aka.ms/TryCopilotStudio) |
| Copilot Acceleration Team technical blog | [aka.ms/TheCustomEngine](https://aka.ms/TheCustomEngine) |
| Samples browser | [microsoft.github.io/CopilotStudioSamples](https://microsoft.github.io/CopilotStudioSamples/) |

## Microsoft Copilot Studio and Agents SDK links

Expand Down
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ baseurl: "/CopilotStudioSamples"

theme: just-the-docs
logo: "/assets/images/logo.png"

# Mermaid diagram support
mermaid:
version: "11"
favicon_ico: "/favicon.ico"

# Default layout for all pages
Expand Down
6 changes: 3 additions & 3 deletions contact-center/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Integrate Copilot Studio agents with contact center platforms and live agent han

| Folder | Description |
|--------|-------------|
| [Skill Handoff](./servicenow/HandoverToLiveAgentUsingSkill/) | Skill-based handoff to live agents using M365 Agents SDK |
| [Salesforce](./servicenow/Salesforce/) | Salesforce Einstein Bot integration via DirectLine API |
| [ServiceNow](./servicenow/ServiceNow/) | ServiceNow Virtual Agent integration via DirectLine |
| [Skill Handoff](./skill-handoff/) | Skill-based handoff to live agents using M365 Agents SDK |
| [Salesforce](./salesforce/) | Salesforce Einstein Bot integration via DirectLine API |
| [ServiceNow](./servicenow/) | ServiceNow Virtual Agent integration via DirectLine |
| [Genesys Handoff](./genesys-handoff/) | Live agent handoff to Genesys (.NET) — *M365 Agents SDK repo* |
22 changes: 12 additions & 10 deletions contact-center/servicenow/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
---
nav_exclude: true
search_exclude: true
title: ServiceNow
parent: Contact Center
nav_order: 3
---
# Engagement Hub Integrations
# Copilot Studio - ServiceNow Integration Samples

Integrate Copilot Studio agents with engagement hub platforms including ServiceNow and Salesforce.
This folder contains sample code for integrating Microsoft Copilot Studio with ServiceNow Virtual Agent, enabling seamless handoff from virtual agent to live agent.

## Contents
## Assets Included

| Folder | Description |
|--------|-------------|
| [HandoverToLiveAgentUsingSkill/](./HandoverToLiveAgentUsingSkill/) | Skill-based handoff to live agents |
| [Salesforce/](./Salesforce/) | Salesforce Einstein Bot integration via DirectLine API |
| [ServiceNow/](./ServiceNow/) | ServiceNow integration via DirectLine |
| Asset | Description | File |
|-------|-------------|------|
| **Azure Function** | Relay service that bridges ServiceNow with the Direct Line API | [`DirectLineAzureFunction/relayToDirectLine`](./DirectLineAzureFunction/) |
| **ServiceNow Script Include** | Custom transformer that detects `handoff.initiate` events and triggers agent escalation | [`ScriptIncludes/CustomDirectLineInboundTransformer.js`](./ScriptIncludes/CustomDirectLineInboundTransformer.js) |

These samples are companion code for the official documentation at: [Microsoft Learn - Copilot Studio with ServiceNow](https://learn.microsoft.com/en-us/microsoft-copilot-studio/customer-copilot-servicenow)
162 changes: 0 additions & 162 deletions contact-center/servicenow/Salesforce/CLAUDE.md

This file was deleted.

17 changes: 0 additions & 17 deletions contact-center/servicenow/ServiceNow/README.md

This file was deleted.

8 changes: 4 additions & 4 deletions extensibility/agents-sdk/relay-bot/AdapterWithErrorHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// Licensed under the MIT License.

using Microsoft.Bot.Builder.Integration.AspNet.Core;
using Microsoft.Extensions.Configuration;
using Microsoft.Bot.Connector.Authentication;
using Microsoft.Extensions.Logging;

namespace Microsoft.PowerVirtualAgents.Samples.RelayBotSample
{
public class AdapterWithErrorHandler : BotFrameworkHttpAdapter
public class AdapterWithErrorHandler : CloudAdapter
{
public AdapterWithErrorHandler(IConfiguration configuration, ILogger<BotFrameworkHttpAdapter> logger)
: base(configuration, logger)
public AdapterWithErrorHandler(BotFrameworkAuthentication auth, ILogger<IBotFrameworkHttpAdapter> logger)
: base(auth, logger)
{
OnTurnError = async (turnContext, exception) =>
{
Expand Down
72 changes: 57 additions & 15 deletions extensibility/agents-sdk/relay-bot/Program.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,62 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Builder;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Integration.AspNet.Core;
using Microsoft.Bot.Connector.Authentication;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.PowerVirtualAgents.Samples.RelayBotSample;
using Microsoft.PowerVirtualAgents.Samples.RelayBotSample.Bots;

namespace Microsoft.PowerVirtualAgents.Samples.RelayBotSample
{
public class Program
var builder = WebApplication.CreateBuilder(args);

//---- Configure services ----
builder.Services.AddHttpClient();
builder.Services.AddControllers()
.AddNewtonsoftJson(options =>
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
}
options.SerializerSettings.MaxDepth = HttpHelper.BotMessageSerializerSettings.MaxDepth;
});


builder.Services.AddSingleton<BotFrameworkAuthentication, ConfigurationBotFrameworkAuthentication>();

// Create the Bot Adapter with error handling enabled.
builder.Services.AddSingleton<IBotFrameworkHttpAdapter, AdapterWithErrorHandler>();

// Create the bot as a transient. In this case the ASP Controller is expecting an IBot.
builder.Services.AddSingleton<IBot, RelayBot>();

// Create the singleton instance of BotService from appsettings
var botService = new BotService();
builder.Configuration.Bind("BotService", (object)botService);
builder.Services.AddSingleton<IBotService>(botService);

// Create the singleton instance of ConversationPool from appsettings
var conversationManager = new ConversationManager();
builder.Configuration.Bind("ConversationPool", conversationManager);
builder.Services.AddSingleton(conversationManager);

var app = builder.Build();

//--- - Configure the HTTP request pipeline ----
if (app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseHsts();
}

app.UseDefaultFiles()
.UseStaticFiles()
.UseWebSockets()
.UseRouting();

app.MapControllers();

app.Run();
14 changes: 7 additions & 7 deletions extensibility/agents-sdk/relay-bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ Deprecated
{: .label .label-red }

{: .caution }
> This sample is deprecated and will be replaced with a modernized M365 Agents SDK sample.
> This sample uses the archived Bot Framework SDK (`Microsoft.Bot.Builder`). It will be replaced with an M365 Agents SDK implementation.

Sample of connecting Bot Framework v4 bot to a Power Virtual Agent bot.
Sample of connecting an Azure Bot Service bot to a Copilot Studio agent using the Direct Line API.

This bot has been created based on [Bot Framework](https://dev.botframework.com), it shows how to create an Azure Bot Service bot that connects to Power Virtual Agents bot
This bot has been created based on [Bot Framework](https://dev.botframework.com), it shows how to create an Azure Bot Service bot that connects to a Copilot Studio agent

## Prerequisites

- [.NET Core SDK](https://dotnet.microsoft.com/download) version 2.1
- [.NET SDK](https://dotnet.microsoft.com/download) version 10.0

```bash
# determine dotnet version
Expand All @@ -30,10 +30,10 @@ This bot has been created based on [Bot Framework](https://dev.botframework.com)
- Clone the repository

```bash
git clone https://github.com/microsoft/PowerVirtualAgentsSample.git
git clone https://github.com/microsoft/CopilotStudioSamples.git
```

- In a terminal, navigate to `BYOBSample/`
- In a terminal, navigate to `extensibility/agents-sdk/relay-bot`
- Update file appsettings.json with your Power Virtual Agent bot id, tenant id, bot name and other settings.

To retrieve your bot's bot ID and tenant ID, click on left side pane's ***Manage***, click ***Channels*** and click on the Azure Bot Service channel that you need to connect to.
Expand All @@ -54,7 +54,7 @@ This bot has been created based on [Bot Framework](https://dev.botframework.com)

- Launch Visual Studio
- File -> Open -> Project/Solution
- Navigate to `BYOBSample/` folder
- Navigate to `extensibility/agents-sdk/relay-bot` folder
- Select `SampleBot.csproj` file
- Press `F5` to run the project

Expand Down
Loading