I want to know if it is possible to build a Copilot Studio agent that can perform the following end-to-end automation:
✅ What the agent should do
- Read an Excel file stored in SharePoint (user provides the file URL)
- Parse the schema from the file, including:
- Site details
- List names
- Column names and types
- Permission groups and role assignments
- Generate a complete PnP PowerShell script dynamically based on that schema
- Execute the script automatically to:
- Create a SharePoint site
- Create lists and columns
- Create and assign permission groups and permissions
✅ Key requirements
- No hardcoded structure — everything must come from the Excel file
- Excel is the single source of truth
- Both script generation and execution are triggered from the Copilot agent
(optionally via Power Automate)
❓ Questions
- Is this end-to-end automation possible using Copilot Studio alone, or does it require:
- Power Automate, plus
- Azure Automation Runbooks / Hybrid Worker / Azure Functions / VM, or similar services to execute PnP PowerShell?
- What is the recommended and secure architecture for running PnP PowerShell from a Copilot-triggered workflow?
- Are there any official Microsoft docs, blogs, or step-by-step guides covering:
- Copilot Studio → Power Automate → PowerShell execution patterns
- Secure authentication methods for PnP PowerShell (App-only, Managed Identity, etc.)
- Schema-driven SharePoint provisioning from Excel or files
- What are the current limitations of this approach, for example:
- Copilot Studio limitations in executing scripts or long-running jobs
- Power Automate limits (timeouts, file size, Excel parsing, throttling)
- Authentication and permission constraints
- Governance and security considerations
- Scalability and error-handling challenges
Any reference architectures, examples, best practices, or known limitations would be greatly appreciated.

Report
All responses (
Answers (