Skip to content

feat(azure.ai.agents): add RemoteA2A kind, OAuth2 + identity auth types#8327

Merged
Nathandrake229 merged 4 commits into
mainfrom
naman/azd-connection-auth-expansion
May 22, 2026
Merged

feat(azure.ai.agents): add RemoteA2A kind, OAuth2 + identity auth types#8327
Nathandrake229 merged 4 commits into
mainfrom
naman/azd-connection-auth-expansion

Conversation

@Nathandrake229

Copy link
Copy Markdown
Contributor

Add support for RemoteA2A connection kind and expand auth type coverage for connection create command.

Kind alias:

  • Add remote-a2a -> RemoteA2A in normalizeKind()

OAuth2 (ARM SDK):

  • Wire OAuth2AuthTypeConnectionProperties with --client-id/--client-secret flags
  • Validate OAuth2 flags are only used with --auth-type oauth2

Identity auth types (raw REST, no ARM SDK structs):

  • UserEntraToken with --audience flag
  • ProjectManagedIdentity (no credentials)
  • AgenticIdentityToken via --auth-type agentic-identity (normalizes name)
  • New raw_connection.go with rawCreateConnection() using runtime.NewRequest PUT

Validation:

  • --client-id/--client-secret rejected for non-oauth2 auth types
  • --audience rejected for non-identity auth types

All auth types POC tested against live workspace (hosted-agents-bugbash).

Add support for RemoteA2A connection kind and expand auth type coverage
for connection create command.

Kind alias:
- Add remote-a2a -> RemoteA2A in normalizeKind()

OAuth2 (ARM SDK):
- Wire OAuth2AuthTypeConnectionProperties with --client-id/--client-secret flags
- Validate OAuth2 flags are only used with --auth-type oauth2

Identity auth types (raw REST, no ARM SDK structs):
- UserEntraToken with --audience flag
- ProjectManagedIdentity (no credentials)
- AgenticIdentityToken via --auth-type agentic-identity (normalizes name)
- New raw_connection.go with rawCreateConnection() using runtime.NewRequest PUT

Validation:
- --client-id/--client-secret rejected for non-oauth2 auth types
- --audience rejected for non-identity auth types

All auth types POC tested against live workspace (hosted-agents-bugbash).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

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.

Pull request overview

This PR extends the azure.ai.agents connection create flow to support additional connection kinds/auth types that aren’t fully represented in the current ARM Go SDK, including a new remote-a2a kind alias and new auth-type options.

Changes:

  • Added remote-a2aRemoteA2A normalization and expanded auth type normalization (OAuth2 + identity-based types).
  • Added OAuth2 support in the typed ARM SDK path via --client-id/--client-secret and associated validation.
  • Introduced a raw REST PUT path (raw_connection.go) for identity auth types not covered by the ARM SDK structs.

Reviewed changes

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

File Description
cli/azd/extensions/azure.ai.agents/internal/connections/cmd/raw_connection.go Adds raw REST connection create implementation and helpers for metadata parsing.
cli/azd/extensions/azure.ai.agents/internal/connections/cmd/context.go Extends resolved context to include subscription ID + credential for raw REST calls.
cli/azd/extensions/azure.ai.agents/internal/connections/cmd/connection.go Wires new flags/validation, routes create to raw REST for identity auth types, and adds OAuth2 typed support + new kind/auth normalizers.
cli/azd/extensions/azure.ai.agents/internal/connections/cmd/connection_test.go Adds unit tests covering new normalization, OAuth2 request building, raw JSON marshaling, and parseKVMap.

Comment thread cli/azd/extensions/azure.ai.agents/internal/connections/cmd/raw_connection.go Outdated
Comment thread cli/azd/extensions/azure.ai.agents/internal/connections/cmd/raw_connection.go Outdated
Comment thread cli/azd/extensions/azure.ai.agents/internal/connections/cmd/connection.go Outdated
Comment thread cli/azd/extensions/azure.ai.agents/internal/connections/cmd/connection.go Outdated
Naman Tyagi and others added 2 commits May 22, 2026 17:18
- URL-escape connection name in raw REST path (url.PathEscape)
- Use runtime.NewResponseError for structured error handling
- Add warning log for malformed key=value pairs in parseKVMap
- Route update through raw REST for identity auth types
- Split error message: buildConnectionBody only lists SDK-handled types
- Remove unused import

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Nathandrake229
Nathandrake229 enabled auto-merge (squash) May 22, 2026 12:12
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the ext-agents azure.ai.agents extension label May 22, 2026
@trangevi trangevi linked an issue May 22, 2026 that may be closed by this pull request
@github-actions

Copy link
Copy Markdown

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Review may take a bit longer — reach out to @rajeshkamal5050 or @kristenwomack if you'd like to discuss prioritization.

@trangevi

Copy link
Copy Markdown
Member

/check-enforcer override

@Nathandrake229
Nathandrake229 merged commit 863e506 into main May 22, 2026
26 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext-agents azure.ai.agents extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add RemoteA2A kind, OAuth2 + identity auth types

3 participants