Skip to content

Feature/azure telemetry exporter#1571

Draft
afourniernv wants to merge 5 commits intoNVIDIA:developfrom
afourniernv:feature/azure-telemetry-exporter
Draft

Feature/azure telemetry exporter#1571
afourniernv wants to merge 5 commits intoNVIDIA:developfrom
afourniernv:feature/azure-telemetry-exporter

Conversation

@afourniernv
Copy link

@afourniernv afourniernv commented Feb 5, 2026

THIS IS A WIP PR. NOT SUITABLE FOR MERGE.

Description

This PR adds Microsoft Agent 365 (A365) integration components to NeMo Agent Toolkit, enabling NAT workflows to:

  • Export telemetry to A365 backend
  • Discover MCP servers configured in A365
  • Host workflows as Teams bots via Bot Framework
  • Receive notifications from Teams, Email, and Office 365 apps

What's Implemented

A365 Telemetry Exporter

  • Full implementation of A365TelemetryExporter integrating with A365 SDK's Agent365Exporter
  • _ReadableSpanAdapter for converting NAT's OtelSpan to A365's ReadableSpan format
  • Async/sync bridge using run_in_executor to handle A365 SDK's synchronous exporter
  • Token resolver support with AuthenticationRef integration
  • Proactive token refresh with caching
  • Plugin registration and discovery working

A365 Tooling Integration

  • A365MCPToolingConfig function group for discovering MCP servers from A365 tooling gateway
  • A365ToolingService wrapper for A365 SDK integration
  • A365MCPToolingFunctionGroup delegation pattern to aggregate multiple discovered MCP servers
  • Comprehensive authentication handling (token extraction, provider resolution, user context)
  • Support for per-server auth provider overrides

A365 Front-End Plugin

  • Full implementation of A365FrontEndPlugin for Bot Framework integration
  • A365FrontEndPluginWorker with dependency injection pattern for SDK components
  • Message handlers for Teams chat messages
  • Notification handlers for email, Word, Excel, PowerPoint, and lifecycle events
  • MsalConnectionManager integration for Entra ID authentication
  • Session management bridge between Bot Framework activities and NAT workflows

Package Structure

  • Package renamed from nvidia-nat-a365-telemetry to nvidia-nat-a365 to reflect expanded scope
  • Modular structure: telemetry/, tooling/, front_end/ submodules
  • Comprehensive exception hierarchy (A365AuthenticationError, A365SDKError, A365ConfigurationError, A365WorkflowExecutionError)

What This Enables

  • Telemetry Export: NAT workflows can now export observability data (spans, traces) to Microsoft Agent 365 backend for centralized monitoring and analysis
  • MCP Server Discovery: NAT can automatically discover and register MCP servers configured in A365, making tools available to workflows without manual configuration
  • Teams Integration: NAT workflows can receive and respond to messages in Microsoft Teams
  • Office 365 Notifications: NAT workflows can receive notifications from Email, Word, Excel, PowerPoint, and lifecycle events
  • Unified A365 Integration: Foundation for additional A365 features

Testing

  • 9 telemetry exporter tests (registration, token resolver, span conversion, auth integration)
  • 18 tooling integration tests (delegation, auth flows, edge cases)
  • 7 tooling registration tests (plugin discovery, config validation)
  • 5 front-end integration tests (worker setup, message handlers, notification handlers)
  • 3 front-end registration tests (plugin discovery, config validation)
  • All tests passing (108 total tests)

Deployment & Configuration

  • Test configuration files in deploy/ directory
  • Authentication test script (deploy/test_auth.py)
  • Deployment documentation (deploy/README.md, deploy/NEXT_STEPS.md)
  • Azure App Registration: 39d13bd9-e35e-4936-a452-9252c593fcce (completed)
  • Admin consent: Granted (authentication tested and working)
  • API permissions configured: Microsoft Graph API (User.Read, Mail.Read, Calendars.Read, Sites.Read.All), Messaging Bot API (AgentData.ReadWrite)

What's Missing for Full Implementation

End-to-End Testing

  • Live telemetry export testing (blocked on Agent ID - need portal access or agent creation)
  • Live Bot Framework integration testing (requires Bot registration in Azure Bot Service)
  • Live Office 365 tool usage testing (requires Copilot 365 tenant configuration)

Documentation

  • Usage examples for telemetry exporter configuration
  • Usage examples for tooling integration configuration
  • Usage examples for front-end configuration
  • Authentication setup guide
  • Troubleshooting guide

Azure Setup (Pending)

  • Agent ID from Microsoft Agent 365 portal (blocked on portal access)
  • Bot registration in Azure Bot Service (may need assistance)
  • Tenant-level admin actions: Frontier Program enablement, Copilot 365 configuration, Commerce enablement, Agent Blueprint registration (a365 setup all)

Related Issues

  • Part of AIQ-2919 (Agent 365 Telemetry Exporter Compatibility)
  • Part of AIQ-2918 (MVP NAT A365 Plugin)
  • Part of AIQ-2917 (Agent Blueprint)
  • Related to AIQ-2683 (Azure Development Tenant/Subscription Standup)

By Submitting this PR I confirm:

  • I am familiar with the Contributing Guidelines.
  • We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license.
  • Any contribution which contains commits that are not Signed-Off will not be accepted.
  • When the PR is ready for review, new or existing tests cover these changes.
  • When the PR is ready for review, the documentation is up to date with these changes.

@copy-pr-bot
Copy link

copy-pr-bot bot commented Feb 5, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

afourniernv and others added 4 commits February 9, 2026 12:40
- Add nvidia_nat_a365_telemetry package with plugin registration
- Implement stub A365OtelExporter and _ReadableSpanAdapter classes
- Add token resolver resolution logic with comprehensive tests
- Register plugin in root pyproject.toml (optional-deps, most extra, uv.sources)
- Add uv-lock pre-commit hook for new package
- Add plugin discovery test

Note: Current implementation includes stubs for:
  - A365OtelExporter.export_otel_spans() (converts OtelSpan to ReadableSpan)
  - _ReadableSpanAdapter (wraps OtelSpan for A365 SDK compatibility)
  - Token resolver string-to-callable conversion

Full integration with A365's _Agent365Exporter SDK pending SDK availability.

Signed-off-by: afourniernv <afournier@nvidia.com>
Signed-off-by: afourniernv <afournier@nvidia.com>
- Implement A365MCPToolingConfig for discovering and registering MCP servers
- Add A365ToolingService wrapper for A365 SDK integration
- Implement delegation pattern with A365MCPToolingFunctionGroup to aggregate multiple MCP servers
- Add comprehensive authentication handling (token extraction, provider resolution, user context)
- Add 18 integration tests covering delegation, auth flows, and edge cases
- Add 7 registration tests for plugin discovery and config validation
- Refactor package from nvidia-nat-a365-telemetry to nvidia-nat-a365 (unified package)
- Update root pyproject.toml to reflect package rename

Signed-off-by: afourniernv <afournier@nvidia.com>
Major Features:
- Add complete A365 front-end plugin implementation:
  * A365FrontEndPlugin: Main plugin integrating NAT workflows with Microsoft Agent 365
  * A365FrontEndPluginWorker: Worker pattern implementation (462 lines)
    - Creates AgentApplication with CloudAdapter, MemoryStorage, MsalConnectionManager
    - Sets up message handlers for Teams chat
    - Implements notification handlers for Email, Word, Excel, PowerPoint, lifecycle events
    - Supports separate workflow routing for notifications via notification_workflow config
    - Handles error handling and cleanup
  * A365FrontEndConfig: Configuration with Entra ID auth, log_level, notification settings
  * Supports custom worker classes via runner_class config option
- Add comprehensive test suite (2000+ lines):
  * Front-end integration tests (542 lines)
  * Front-end registration tests (233 lines)
  * Telemetry exporter integration tests (294 lines)
  * Telemetry registration tests (123 lines)
  * Tooling auth integration tests (613 lines)
  * Tooling registration tests (204 lines)

Refactoring & Improvements:
- Add shared exceptions module (A365Error, A365AuthenticationError, A365ConfigurationError,
  A365SDKError, A365WorkflowExecutionError) for consistent error handling
- Refactor tooling module:
  * Extract tooling config to separate tooling_config.py file
  * Update type hints to Python 3.10+ syntax (| instead of Union/Optional)
  * Optimize tool_overrides conversion (move outside loop for efficiency)
  * Improve error handling with A365ConfigurationError for validation failures
  * Add defensive checks for server.mcp_server_name (handle None/empty)
- Enhance telemetry module:
  * Add AuthenticationRef support with proactive token refresh
  * Remove string import path option for token_resolver (use AuthenticationRef only)
  * Improve token resolver implementation with async/sync bridge
- Remove unused notifications module (functionality implemented directly in worker)
- Update docstrings and error messages throughout
- Update dependencies in pyproject.toml and uv.lock

This commit adds a production-ready A365 front-end plugin with comprehensive test coverage
and improves code quality across telemetry and tooling modules.
- Refactor front-end to Worker pattern with DI support
- Add log_level and notification_workflow features
- Add AuthenticationRef support for telemetry token resolution
- Implement thread-safe token cache with proactive refresh
- Add comprehensive test coverage (105 tests, +4 new test files)
- Remove duplicate test files and improve test reliability
- Improve error handling across all modules
- Modernize type hints and remove redundant comments

Signed-off-by: afourniernv <afournier@nvidia.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@afourniernv afourniernv force-pushed the feature/azure-telemetry-exporter branch from 6b21eeb to 99aa124 Compare February 9, 2026 19:51
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.

1 participant