Skip to content

Commit 0863268

Browse files
authored
Merge pull request #835 from pkbullock/main-sample-deploy-ttk-bulk
Main sample deploy ttk bulk
2 parents e5034bb + 3c95217 commit 0863268

File tree

9 files changed

+187
-4
lines changed

9 files changed

+187
-4
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
> [!div class="highlight-tool"]
2+
> Check out the **Microsoft Teams Toolkit CLI** to learn more at: https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/teams-toolkit-cli?pivots=version-three

docfx/templates/material/partials/head.tmpl.partial

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<title>{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}</title>
6-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
77
<meta name="title" content="{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}">
88
<meta name="generator" content="docfx {{_docfxVersion}}">
99
{{#_description}}<meta name="description" content="{{_description}}">{{/_description}}

scripts/_template-script-submission/assets/template.sample.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@
137137
"name":"Want to learn more about Whiteboard Admin cmdlets",
138138
"description":"Check out the Whiteboard Admin cmdlets documentation site to get started and for the reference to the commands.",
139139
"url": "https://learn.microsoft.com/powershell/module/whiteboard"
140+
},
141+
{
142+
"name":"Want to learn more about Teams Toolkit CLI",
143+
"description":"Check out the documentation site to get started and for the reference on performing operations on agents",
144+
"url": "https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/teams-toolkit-cli?pivots=version-three"
140145
}
141146
]
142147
}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Bulk Deployment of Teams Toolkit Declarative Agents
2+
3+
## Summary
4+
5+
This sample deploys multiple Copilot Teams Toolkit declarative agents in bulk using Teams Toolkit CLI, you will need to ensure you are logged in and installed the prerequisites. This runs thorugh a set structure (see below) and provisions the agents into Microsoft 365 Copilot - the chat experience. This is not deploying to the organisation store however this can be modified to do so.
6+
7+
>Note: This script is a campanion to this sample: https://pnp.github.io/script-samples/copilot-teams-toolkit-da-apply-template/README.html
8+
9+
![Example Screenshot](assets/example.png)
10+
11+
## Prerequisites
12+
13+
This script requires the following:
14+
- [Teams Toolkit CLI](https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/teams-toolkit-cli?pivots=version-three) installed
15+
16+
Install the Teams Toolkit CLI using the following command:
17+
18+
- npm install -g @microsoft/teamsapp-cli
19+
- Run to test: teamsapp -h
20+
21+
## Folder Structure
22+
23+
- Base Folder
24+
- Copilot-Extensibility-Template
25+
- color.png
26+
- manifest.json
27+
- declarativeAgent.json
28+
- Instruction.md
29+
- outline.png
30+
- Copilot-Studio-Agent (Just create the folder, the script will populate the contents + the template)
31+
- appPackage
32+
- manifest.json
33+
- declarativeAgent.json
34+
- Instruction.md
35+
...
36+
- Other Agent 1
37+
- Other Agent 2
38+
- Other Agent 3
39+
- Other Agent 4
40+
- Invoke-CoolScript.ps1
41+
42+
# [PowerShell - Teams App CLI (Single Deployment)](#tab/ps1)
43+
```powershell
44+
45+
[CmdletBinding()]
46+
param (
47+
$targetFolderName = "Copilot-Studio-Agent"
48+
)
49+
begin {
50+
51+
$startingPath = Get-Location
52+
$targetFolder = Join-Path -Path "$(Get-Location)" -ChildPath "$($targetFolderName)"
53+
54+
# ------------------------------------------------------------------------------
55+
# Introduction
56+
# ------------------------------------------------------------------------------
57+
58+
Write-Host "*** This script will generate out all the agents ***" -ForegroundColor Green
59+
60+
# ------------------------------------------------------------------------------
61+
62+
}
63+
process {
64+
65+
# ------------------------------------------------------------------------------
66+
# Deploying the agent
67+
# ------------------------------------------------------------------------------
68+
# Test if the target folder contains teamsapp.yml file
69+
$teamsAppFile = "teamsapp.yml"
70+
$teamsAppFilePath = Join-Path -Path $targetFolder -ChildPath $teamsAppFile
71+
if (Test-Path -Path $teamsAppFilePath) {
72+
73+
Write-Host "Deploying the target agent $targetFolder" -ForegroundColor Green
74+
Set-Location -Path $targetFolder
75+
76+
# Yeap, thats it. If you are not logged in, it will prompt you for logging in.
77+
teamsapp provision
78+
79+
Write-Host "Agent $targetFolder Deployed." -ForegroundColor Cyan
80+
}else{
81+
Write-Host "File $teamsAppFile does NOT exist in the target folder." -ForegroundColor Red
82+
}
83+
84+
}
85+
end{
86+
Set-Location -Path $startingPath
87+
Write-Host "Done! :)" -ForegroundColor Green
88+
}
89+
90+
```
91+
92+
# [PowerShell - Teams App CLI (Bulk Deployment)](#tab/ps2)
93+
```powershell
94+
95+
Read-Host -Prompt "This script will bulk deploy for all agents in the current directory. Press Enter to continue or Ctrl+C to cancel."
96+
97+
.\Set-Deploy.ps1 -targetFolderName "Copilot-Studio-Agent"
98+
.\Set-Deploy.ps1 -targetFolderName "Other Agent 1"
99+
.\Set-Deploy.ps1 -targetFolderName "Other Agent 2"
100+
.\Set-Deploy.ps1 -targetFolderName "Other Agent 3"
101+
102+
```
103+
***
104+
[!INCLUDE [More about Teams Toolkit CLI](../../docfx/includes/MORE-TEAMSTOOLKITCLI.md)]
105+
106+
## Source Blog Article
107+
108+
- [Create Microsoft 365 Copilot declarative agents with Teams Toolkit CLI | pkbullock.com](https://pkbullock.com/blog/2025/create-declarative-agent-with-teams-toolkit-cli)
109+
110+
111+
## Contributors
112+
113+
| Author(s) |
114+
|-----------|
115+
| Paul Bullock |
116+
117+
[!INCLUDE [DISCLAIMER](../../docfx/includes/DISCLAIMER.md)]
118+
<img src="https://m365-visitor-stats.azurewebsites.net/script-samples/scripts/copilot-bulk-deploy-declarative-agents" aria-hidden="true" />
Loading
Loading
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
[
2+
{
3+
"name": "copilot-bulk-deploy-declarative-agents",
4+
"source": "pnp",
5+
"title": "Bulk Deployment of Teams Toolkit Declarative Agents",
6+
"shortDescription": "This sample deploys multiple Copilot Teams Toolkit declarative agents in bulk using PowerShell and Teams Toolkit CLI.",
7+
"url": "https://pnp.github.io/script-samples/copilot-bulk-deploy-declarative-agents/README.html",
8+
"longDescription": [
9+
""
10+
],
11+
"creationDateTime": "2025-05-17",
12+
"updateDateTime": "2025-05-17",
13+
"products": [
14+
"Microsoft 365 Copilot"
15+
],
16+
"metadata": [
17+
{
18+
"key": "POWERSHELL",
19+
"value": "7.5.1"
20+
}
21+
],
22+
"categories": [
23+
"Deploy",
24+
"Microsoft 365 Copilot"
25+
],
26+
"tags": [
27+
"<Cmdlets-Used>"
28+
],
29+
"thumbnails": [
30+
{
31+
"type": "image",
32+
"order": 100,
33+
"url": "https://raw.githubusercontent.com/pnp/script-samples/main/scripts/copilot-bulk-deploy-declarative-agents/assets/preview.png",
34+
"alt": "Preview of the sample Bulk Deployment of Teams Toolkit Agents"
35+
}
36+
],
37+
"authors": [
38+
{
39+
"gitHubAccount": "pkbullock",
40+
"company": "",
41+
"pictureUrl": "https://github.com/pkbullock.png",
42+
"name": "Paul Bullock"
43+
}
44+
],
45+
"references": [
46+
{
47+
"name":"Want to learn more about Teams Toolkit CLI",
48+
"description":"Check out the documentation site to get started and for the reference on performing operations on agents",
49+
"url": "https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/teams-toolkit-cli?pivots=version-three"
50+
}
51+
]
52+
}
53+
]

scripts/copilot-teams-toolkit-da-apply-template/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ Read-Host -Prompt "This script will set the template overlay for all folders in
177177
.\Set-TemplateOverlay.ps1 -targetFolderName "Other-Agent-4" -appName "Other Agent 4" -appShortName "Other-Agent-4-"
178178
```
179179
***
180+
[!INCLUDE [More about Teams Toolkit CLI](../../docfx/includes/MORE-TEAMSTOOLKITCLI.md)]
180181

181182
## Template Files
182183

scripts/copilot-teams-toolkit-da-apply-template/assets/sample.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
],
2424
"metadata": [
2525
{
26-
"key": "PNP-POWERSHELL",
27-
"value": "1.11.0"
26+
"key": "POWERSHELL",
27+
"value": "7.5.1"
2828
}
2929
],
3030
"categories": [
@@ -58,7 +58,11 @@
5858
}
5959
],
6060
"references": [
61-
null
61+
{
62+
"name":"Want to learn more about Teams Toolkit CLI",
63+
"description":"Check out the documentation site to get started and for the reference on performing operations on agents",
64+
"url": "https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/teams-toolkit-cli?pivots=version-three"
65+
}
6266
]
6367
}
6468
]

0 commit comments

Comments
 (0)