Skip to content

Add post: Hosted Agent Service Pattern for Copilot Studio#246

Open
jpad5 wants to merge 15 commits intomainfrom
jpad5-4
Open

Add post: Hosted Agent Service Pattern for Copilot Studio#246
jpad5 wants to merge 15 commits intomainfrom
jpad5-4

Conversation

@jpad5
Copy link
Copy Markdown
Contributor

@jpad5 jpad5 commented Mar 27, 2026

  • Ran /review-post and addressed feedback (4 rounds)
  • Local server renders correctly
  • All images have alt text and captions
  • 2 internal links to related posts
  • Tags chosen for Chirpy Further Reading overlap
  • Fixed intro contradiction: clarified what dev controls vs Copilot Studio controls
  • Fixed title: "Hosted Agent Pattern" → "Hosted Agent Service Pattern" for consistency with post body

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

jpad5 added 3 commits March 26, 2026 18:55
- Scope article to MCS context; clarify target audience
- Add MCS-specific architecture diagram showing PP connector layer
- Fix auth comparison: in MCS both use same connector/connection framework
- Correct DLP claim: DLP applies at connector level, MCP tools may be ungoverned
- Fix performance claims: MCP adds tool discovery overhead in MCS
- Fix control level: makers cannot override MCP tool descriptions in MCS
- Add orchestration delegation tradeoff
- Rewrite conclusion with MCS-specific guidance
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Chirpy blog post describing the “Hosted Agent Service” pattern for Copilot Studio, including an architecture walkthrough and code excerpts, plus the associated header image asset.

Changes:

  • Added a new post: “Your Service, Your Auth: The Hosted Agent Pattern for Copilot Studio”
  • Added a new header image under /assets/posts/hosted-agent-service/
  • Referenced an existing architecture diagram asset for the post body

Reviewed changes

Copilot reviewed 1 out of 3 changed files in this pull request and generated 4 comments.

File Description
assets/posts/hosted-agent-service/has-title.jpg New header/cover image used by the post front matter.
_posts/2026-03-26-hosted-agent-service-pattern.md New post content covering the pattern, OBO flow, deployment steps, and internal links.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
jpad5 and others added 3 commits March 26, 2026 23:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 3 changed files in this pull request and generated 2 comments.

jpad5 and others added 2 commits March 27, 2026 00:01
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 3 changed files in this pull request and generated 1 comment.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 3 changed files in this pull request and generated 3 comments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 3 changed files in this pull request and generated 3 comments.

@@ -0,0 +1,193 @@
---
layout: post
title: "[Demo] Your Service, Your Auth: The Hosted Agent Pattern for Copilot Studio"
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title uses "Hosted Agent Pattern" while the rest of the post consistently calls it the "Hosted Agent Service" pattern. Consider aligning the title with the term used throughout the article to avoid reader confusion and improve searchability.

Copilot generated this review using guidance from repository custom instructions.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit 01cf5a9. The title now reads "The Hosted Agent Service Pattern for Copilot Studio", matching the terminology used consistently throughout the post body.

Copilot AI and others added 2 commits March 27, 2026 07:28
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 3 changed files in this pull request and generated 1 comment.

The `Index.cshtml.cs` page model acquires the token and exposes it to the frontend JavaScript, which calls the Agent Service via `fetch()`:

```javascript
const response = await fetch('http://localhost:5020/api/agent/invoke', {
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fetch() example hard-codes http://localhost:5020/.... This will fail in non-local scenarios and can be blocked as mixed-content if the page is served over HTTPS. Consider using a relative URL (same origin) or calling a configurable base URL (e.g., injected from server config) so the snippet works beyond local dev.

Suggested change
const response = await fetch('http://localhost:5020/api/agent/invoke', {
const response = await fetch('/api/agent/invoke', {

Copilot uses AI. Check for mistakes.
@adilei
Copy link
Copy Markdown
Collaborator

adilei commented Mar 27, 2026

Hey Jay, thanks for putting this together — the code sample is solid and the technical walkthrough is well-structured. The OBO flow explanation, the Bicep deployment, and the architecture diagram are all clear. A few things I'd love to see addressed before we merge:

The core question: when would someone need this pattern?

The post does a great job explaining how the Hosted Agent Service works, but I'm left wondering why I'd reach for it instead of simpler alternatives that already exist in Copilot Studio:

  • JWT validation and Conditional Access: The M365 Agents SDK connects to Copilot Studio through an API that's native to Entra ID, so Conditional Access policies are already enforced. The validation you're doing in the proxy — is Copilot Studio not already doing that?
  • Custom frontend: WebChat can be embedded in any web app with full UI control, and it supports SSO. What scenario requires bypassing it entirely?

The post currently reads as a general-purpose architecture, but I think its real value is in a very specific set of constraints. It would be great to call those out explicitly in the intro. Something like: "If you've tried X and Y and hit this wall, that's when you need this pattern."

— Adi

@jpad5
Copy link
Copy Markdown
Contributor Author

jpad5 commented Mar 27, 2026

Hey Jay, thanks for putting this together — the code sample is solid and the technical walkthrough is well-structured. The OBO flow explanation, the Bicep deployment, and the architecture diagram are all clear. A few things I'd love to see addressed before we merge:

The core question: when would someone need this pattern?

The post does a great job explaining how the Hosted Agent Service works, but I'm left wondering why I'd reach for it instead of simpler alternatives that already exist in Copilot Studio:

  • JWT validation and Conditional Access: The M365 Agents SDK connects to Copilot Studio through an API that's native to Entra ID, so Conditional Access policies are already enforced. The validation you're doing in the proxy — is Copilot Studio not already doing that?
  • Custom frontend: WebChat can be embedded in any web app with full UI control, and it supports SSO. What scenario requires bypassing it entirely?

The post currently reads as a general-purpose architecture, but I think its real value is in a very specific set of constraints. It would be great to call those out explicitly in the intro. Something like: "If you've tried X and Y and hit this wall, that's when you need this pattern."

— Adi

Thanks for the pointers, Adi. I have updated to reflect your feedback.

-Jay

jpad5 added 2 commits March 31, 2026 15:31
- Replace simulated Copilot Studio calls with real CopilotClient SDK code
- Split single 40-line code block into two focused OBO exchange sections
- Add dual OBO flow explanation (Power Platform API + Enterprise API)
- Update Program.cs wiring to show CopilotClient SDK registration
- Remove redundant CopilotClient SDK Integration section
- Add 3rd internal link (connector-consent-card-obo)
- Replace sso tag with m365-agents-sdk for better Further Reading overlap
- Remove [Demo] prefix from title
- Reduce em-dash overuse throughout
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.

4 participants