Skip to content

Implement health checks for Azure AI Inference ChatCompletionsClient and EmbeddingsClient#15969

Open
Formatted wants to merge 1 commit intomicrosoft:mainfrom
Formatted:add-azure-openai-inference-health-checks
Open

Implement health checks for Azure AI Inference ChatCompletionsClient and EmbeddingsClient#15969
Formatted wants to merge 1 commit intomicrosoft:mainfrom
Formatted:add-azure-openai-inference-health-checks

Conversation

@Formatted
Copy link
Copy Markdown

Description

ChatCompletionsClient and EmbeddingsClient registrations in Aspire.Azure.AI.Inference had GetHealthCheckEnabled hardcoded to false and CreateHealthCheck throwing NotImplementedException, meaning health checks were silently disabled for both client types regardless of configuration.

This PR adds AzureAIInferenceChatCompletionsHealthCheck and AzureAIInferenceEmbeddingsHealthCheck, which use the already-registered SDK clients to call GetModelInfoAsync() (a single read-only HTTP GET to /info), verifying endpoint connectivity. A DisableHealthChecks property is added to ChatCompletionsClientSettings to allow opt-out, consistent with the DisableMetrics/DisableTracing pattern. The conformance test SetHealthCheck override is also enabled.

AzureOpenAIClient health checks remain disabled — the Azure.AI.OpenAI SDK deliberately throws NotSupportedException on GetOpenAIModelClient(), and all other sub-clients require a deployment name and initiate real inference operations. The existing NotImplementedException is replaced with a NotSupportedException and an explanatory comment.

Fixes # (issue) — N/A, addressing existing NotImplementedException / hardcoded false


Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes — SetHealthCheck conformance tests enabled for ConformanceTests in Aspire.Azure.AI.Inference.Tests
  • Did you add public API?
    • Yes — DisableHealthChecks on ChatCompletionsClientSettings
      • Did you have an API Review for it?
        • Yes
        • No — property follows the established DisableMetrics/DisableTracing pattern on the same type; no new design decisions
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No — property is self-explanatory and consistent with sibling properties on the same class
  • Does the change make any security assumptions or guarantees?
    • No
  • Does the change require an update in our Aspire docs?
    • No

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15969

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15969"

@Formatted
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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