Skip to content

Enablement of Copilot Studio Samples#109

Merged
pkbullock merged 21 commits intopnp:mainfrom
pkbullock:main-mcs
Mar 15, 2026
Merged

Enablement of Copilot Studio Samples#109
pkbullock merged 21 commits intopnp:mainfrom
pkbullock:main-mcs

Conversation

@pkbullock
Copy link
Member

@pkbullock pkbullock commented Feb 15, 2026

--- Copilot Review

This pull request introduces several new Microsoft 365 Copilot agent samples to .github/samples.json, updates contribution documentation to support Copilot Studio samples, improves PowerShell scripting for path handling, and adds a workflow to block zip files in the samples directory. The most important changes are summarized below:

Documentation Updates:

  • Updated CONTRIBUTING.md to clarify support for Copilot Studio (MCS) samples, including new folder structure guidelines and instructions for exporting solution contents using Power Platform CLI. Also updated sample naming conventions and README template references. [1] [2] [3]

Repository Automation:

  • Added a new GitHub Actions workflow (.github/workflows/no-zip-in-samples.yml) that scans the samples/** directory for .zip files and comments on pull requests if any are found, enforcing the policy against including zip archives in sample submissions.

PowerShell Script Improvements:

  • Refactored .github/Generate-SampleList.ps1 to use Join-Path for more robust and cross-platform path handling when referencing files and directories. [1] [2] [3]

Sample List Update:

  • Updated README.md to include the new "Adaptive Card dialog" sample in the sample list table.

@pkbullock
Copy link
Member Author

Temporarily disabling workflow, as its caused by a permissions error.

@pkbullock
Copy link
Member Author

Looking at second submission option via Copilot Studio VSC Extension which produces a set of YAML Files.

@pkbullock
Copy link
Member Author

pkbullock commented Feb 22, 2026

I have added the method of submission, for Copilot Studio for Visual Studio Code samples, since there is two methods of submission. This includes a second agent with example.

@sebastienlevert @garrytrinder - would love your reviews.

References #100

There is room for improvement for automation, but at this stage wanted to get the ball rolling.

@pkbullock pkbullock marked this pull request as ready for review February 22, 2026 11:20
@pkbullock
Copy link
Member Author

To update from a discussion with @garrytrinder, to

  • add a .vscode to the samples to suggest the recommended vs extensions appropriate to the sample
  • consider a single approach to hosting contents of the sample - solutions vs clone. The lean is towards VSC extension rather than solution based but requires testing to ensure the agents referred components e.g. PA as tools, DV are included as part of the tools output.
  • Paul to document a easier way to explain the process - a mermaid diagram waiting to happen.
  • Seek opinions of @Laskewitz and @PaoloPia for these approaches.

@pkbullock
Copy link
Member Author

Option 1 - Copilot Studio Solution Workflow

This document explains the export and import workflow for Copilot Studio agent solutions.

Solution Export (CONTRIBUTING.md) and Import Process (README-template.MD)

graph LR
    subgraph export["EXPORT (CONTRIBUTING.md)"]
        A["Power Platform<br/>Agent Solution"] -->|Clone| B["pac solution clone<br/>--name MyAgent<br/>--outputDirectory .<br/>--packagetype Unmanaged"]
        B --> C["Source Files<br/>in src/"]
        C --> D["Ready for<br/>Development"]
    end
    
    subgraph import["IMPORT (README-template.md)"]
        E["Source Files<br/>in src/"] -->|Pack| F["pac solution pack<br/>--zipfile YourAgent.zip<br/>--folder ./src"]
        F --> G["YourAgent.zip<br/>Created"]
        G --> H{Environment}
        H -->|Default| I["pac solution import<br/>--path YourAgent.zip"]
        H -->|Specific| J["pac env list<br/>+ pac solution import<br/>-env environment-guid"]
        I --> K["Solution in<br/>Power Platform"]
        J --> K
    end
    
    D -.->|Develop & Deploy| E
    
    style A fill:#e1f5ff
    style D fill:#e8f5e9
    style E fill:#e8f5e9
    style G fill:#fff3e0
    style K fill:#f3e5f5
Loading

Export (Clone from Power Platform)

The export process uses the Power Platform CLI to clone a solution from your Power Platform environment. Refer to CONTRIBUTING.md for detailed instructions.

Command:

pac solution clone --name <your-package-name> --outputDirectory . --packagetype Unmanaged

Import (Deploy to Power Platform)

The import process packages your source files into a solution zip and imports it to Power Platform. Refer to README-template.md for detailed instructions.

Commands:

# Package the solution
pac solution pack --zipfile <YourAgent>.zip --folder ./mcs-YOUR_AGENT_FOLDER/src

# Import to default environment
pac solution import --path <YourAgent>.zip

# Import to specific environment
pac env list
pac solution import --path <YourAgent>.zip -env <environment-guid>

Option 2 - Creating and Deploying Copilot Studio Agents using Visual Studio Code Extension

Copilot Studio VS Code Extension Workflow

This document explains the creation and deployment workflow for Copilot Studio agents using the Visual Studio Code extension.

Agent Creation and Deployment Process

graph LR
    subgraph create["CREATE (CONTRIBUTING.md)"]
        A["Scaffold Sample<br/>from Template"] -->|Clone/Create| B["Build Agent with<br/>VS Code Extension"]
        B --> C["YAML Files<br/>in src/"]
        C --> D["Finalize Documentation<br/>& Assets"]
        D --> E["Ready for<br/>Deployment"]
    end
    
    subgraph deploy["DEPLOY (README-template.md)"]
        F["YAML Files<br/>in src/"] -->|Open| G["Open src folder<br/>in VS Code"]
        G --> H["Run: Copilot Studio:<br/>Reattach Agent"]
        H --> I["Select Target<br/>Environment"]
        I --> J["Agent Reattached<br/>to Environment"]
        J --> K["Live in<br/>Power Platform"]
    end
    
    E -.->|Deploy| F
    
    style A fill:#e1f5ff
    style E fill:#e8f5e9
    style F fill:#e8f5e9
    style J fill:#fff3e0
    style K fill:#f3e5f5
Loading

Create (Build with VS Code Extension)

The creation process uses the Visual Studio Code extension to build your Copilot Studio agent. Refer to CONTRIBUTING.md for detailed contribution guidelines.

Steps:

  1. Scaffold your sample:

    cd samples
    cp -R ../templates/mcs-copilot-studio mcs-MyNewAgent
    cd mcs-MyNewAgent
  2. Use the VS Code extension to clone or create your agent within the mcs-MyNewAgent folder

  3. Rename the generated folder to src

  4. Complete your README.md file and sample.json configuration

  5. Add high-quality screenshots (1920x1080) to the assets folder

Deploy (Reattach Agent with VS Code Extension)

The deployment process uses the VS Code extension to reattach your agent to a Power Platform environment. Refer to README-template.md for detailed deployment instructions.

Steps:

  1. Open your sample's src folder as the root in VS Code
  2. Ensure you are signed into your tenant with appropriate environment access
  3. Press F1 and run: Copilot Studio: Reattach Agent
  4. Select your target Power Platform environment
  5. Verify the success notification: "New Agent reattached"
  6. Check the Copilot Studio portal to confirm your agent is deployed

File Structure

mcs-MyNewAgent/
├── src/                    # YAML files for your agent
├── assets/                 # Screenshots and configuration
│   └── sample.json        # Sample metadata
└── README.md              # Documentation for end users

@garrytrinder
Copy link
Member

We discussed last week about deciding on which approach to take.

The pp-cli approach creates files during the export that are not readable by humans, but are complete solutions (can include additional resources), whereas the Copilot Studio VS Code extension generates readable and editable files but only applies to the agent and does not include additional resources.

@pkbullock
Copy link
Member Author

I have removed the guidance from this PR (we can already refer in future). Right ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants