Skip to content

Implement Health Checks for Auth Service #143

@willvelida

Description

@willvelida

Parent Issue

Part of #119 - Implement Custom Health Probes and Dependency Health Checks

Overview

Apply the proven health check pattern from #136 (Weight API) to the Auth Service. Note: Auth Service does not depend on Fitbit API, so it only includes Cosmos DB and Key Vault health checks.

Scope

  • src/Biotrackr.Auth.Svc/
  • infra/apps/auth-service/main.bicep

Tasks

1. Install Health Check Packages

Add to Biotrackr.Auth.Svc.csproj:

<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="9.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.CosmosDb" Version="8.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.AzureKeyVault" Version="8.0.1" />

2. Implement Health Check Endpoints

Apply proven pattern from #136 (minus Fitbit dependency):

  • Health checks for self, Cosmos DB (lightweight), Key Vault only
  • No Fitbit API health check (Auth Service doesn't use Fitbit)
  • Configure /health/live, /health/ready, /health/startup endpoints

3. Update Bicep Configuration

Update infra/apps/auth-service/main.bicep:

  • Apply same probe configuration as Weight Service

4. Add Integration Tests

  • Verify health endpoints return correct status codes
  • Test dependency failure scenarios (Cosmos DB, Key Vault)

Acceptance Criteria

  • Health check packages installed
  • /health/live, /health/ready, /health/startup endpoints implemented
  • Cosmos DB and Key Vault health checks configured (no Fitbit)
  • Bicep probe configuration updated
  • Integration tests pass
  • Deployed to dev environment and validated

Dependencies

References

Notes

Auth Service has simpler health checks since it doesn't integrate with Fitbit API.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions