Skip to content

fix(infra): add ChatApiAgentIdentityId to Reporting.Api params#301

Merged
willvelida merged 2 commits intomainfrom
fix/reporting-api-agent-identity-config
Apr 19, 2026
Merged

fix(infra): add ChatApiAgentIdentityId to Reporting.Api params#301
willvelida merged 2 commits intomainfrom
fix/reporting-api-agent-identity-config

Conversation

@willvelida
Copy link
Copy Markdown
Owner

Summary

Add the missing chatApiAgentIdentityId parameter to the Reporting.Api dev Bicep params file. This restores Chat.Api's ability to authenticate with Reporting.Api for report generation.

Root Cause

PR #274 extended the Reporting.Api authorization policy to accept multiple agent identity callers via azp claim validation. The chatApiAgentIdentityId Bicep parameter defaults to '', and the App Configuration key Biotrackr:ChatApiAgentIdentityId was never provisioned via IaC. Without this key, the authorization policy rejects Chat.Api requests with 403 Forbidden — the JWT is valid but the azp claim doesn't match any configured caller ID.

Evidence

  • Chat.Api dependency telemetry: POST /api/reports/generate → 403 Forbidden
  • Container logs confirm healthy startup (app on port 8080, sidecar on port 4321)
  • Biotrackr:ChatApiAgentIdentityId confirmed missing from Azure App Configuration
  • Biotrackr:ReportingSvcAgentIdentityId was set (from PR feat(reporting-svc): add scheduled health summary service #276), so the policy only accepted Reporting.Svc

Changes

Modified

  • infra/apps/reporting-api/main.dev.bicepparam — Added param chatApiAgentIdentityId = '707307f7-ffc4-4744-a66b-19fa942c1c10'

Validation

  • Bicep param references existing parameter definition in main.bicep (line 50)
  • Conditional App Config deployment at line 382 will create the key when chatApiAgentIdentityId is not empty
  • No code changes required — authorization policy logic is correct

- Set chatApiAgentIdentityId in dev bicepparam to restore Chat.Api authorization

Signed-off-by: Will Velida <willvelida@hotmail.co.uk>
agent: github-copilot
model: Claude Opus 4.6
contribution: code-generation
Copilot AI review requested due to automatic review settings April 19, 2026 09:48
@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

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

This PR restores Chat.Api → Reporting.Api agent-to-agent authentication by ensuring the Reporting.Api dev deployment provisions the missing Biotrackr:ChatApiAgentIdentityId App Configuration value (used for azp claim validation).

Changes:

  • Add chatApiAgentIdentityId to infra/apps/reporting-api/main.dev.bicepparam with the dev Chat.Api agent identity GUID.

- Change claude-sonnet-4-6 to claude-sonnet-4.6 to match Copilot CLI naming

Signed-off-by: Will Velida <willvelida@hotmail.co.uk>
agent: github-copilot
model: Claude Opus 4.6
contribution: code-generation
@github-actions
Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Health
Biotrackr.Reporting.Api 73% 62%
Summary 73% (451 / 621) 62% (99 / 159)

Minimum allowed line rate is 60%

@willvelida willvelida merged commit 81b646b into main Apr 19, 2026
21 of 22 checks passed
@willvelida willvelida deleted the fix/reporting-api-agent-identity-config branch April 19, 2026 10:28
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.

3 participants