New sample how to invoke Power Automate flow from declarative agent#141
New sample how to invoke Power Automate flow from declarative agent#141reshmee011 wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new TypeSpec-based declarative agent sample intended to invoke a Power Automate HTTP-triggered flow (e.g., sending an email) via Microsoft 365 Agents Toolkit.
Changes:
- Introduces TypeSpec agent + action definitions for invoking a Power Automate flow.
- Adds Agents Toolkit pipelines (provision/publish) and a script to generate
env.tspfrom.env.*. - Adds sample documentation and VS Code workspace scaffolding.
Reviewed changes
Copilot reviewed 16 out of 22 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| samples/da-typespec-powerautomate/tspconfig.yaml | Configures OpenAPI3 + M365 Copilot emitters and output locations. |
| samples/da-typespec-powerautomate/src/agent/prompts/instructions.tsp | Adds the agent instruction prompt guiding flow invocation. |
| samples/da-typespec-powerautomate/src/agent/main.tsp | Declares the agent and exposes the Power Automate action. |
| samples/da-typespec-powerautomate/src/agent/actions/invokePAFlow.tsp | Defines the Power Automate “sendEmail” action, schema, and OAuth2 auth model. |
| samples/da-typespec-powerautomate/scripts/generate-env.js | Generates src/agent/env.tsp from env/.env.{environment}. |
| samples/da-typespec-powerautomate/README.md | Documents setup and usage steps for the sample. |
| samples/da-typespec-powerautomate/package.json | Adds compile + env-generation scripts and TypeSpec dependencies. |
| samples/da-typespec-powerautomate/package-lock.json | Locks dependency graph for the sample. |
| samples/da-typespec-powerautomate/m365agents.yml | Adds provision/publish pipelines for compiling and packaging the agent. |
| samples/da-typespec-powerautomate/m365agents.local.yml | Adds local provisioning pipeline for the agent. |
| samples/da-typespec-powerautomate/env/.env.dev | Provides dev environment variables template for Power Automate endpoints. |
| samples/da-typespec-powerautomate/AGENTS.md | Adds TypeSpec/agent authoring guidance for contributors. |
| samples/da-typespec-powerautomate/.vscode/tasks.json | Adds VS Code tasks for local provisioning/debug flows. |
| samples/da-typespec-powerautomate/.vscode/settings.json | Configures workspace settings (read-only generated files, schema stubs). |
| samples/da-typespec-powerautomate/.vscode/launch.json | Adds browser launch configurations for Copilot preview. |
| samples/da-typespec-powerautomate/.vscode/extensions.json | Recommends Agents Toolkit + TypeSpec extensions. |
| samples/da-typespec-powerautomate/.gitignore | Ignores generated output and local env artifacts. |
Files not reviewed (1)
- samples/da-typespec-powerautomate/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| authorizationUrl: "https://login.microsoftonline.com/<tenantid>/oauth2/v2.0/authorize"; | ||
| tokenUrl: "https://login.microsoftonline.com/<tenantid>/oauth2/v2.0/token"; | ||
| refreshUrl: "https://login.microsoftonline.com/<tenantid>/oauth2/v2.0/refresh"; |
There was a problem hiding this comment.
@garrytrinder : I can't use string interpolation with the oAuth2Auth,

I have specified within the Readme file to amend those placeholders.
garrytrinder
left a comment
There was a problem hiding this comment.
Thanks for your contribution @reshmee011 can you address the comments, then we can merge.
sebastienlevert
left a comment
There was a problem hiding this comment.
Please resolve Copilot comments, rest is great!
|
Thanks @garrytrinder for the review. There’s just one outstanding Copilot comment left. I’m not sure how to reference an environment variable within the oAuth2Auth object. |
No description provided.