Skip to content

Conversation

@alexwolfmsft
Copy link
Contributor

@alexwolfmsft alexwolfmsft commented Dec 11, 2025

Summary

Describe your changes here.

Fixes #Issue_Number (if available)


Internal previews

📄 File 🔗 Preview link
docs/azure/sdk/dependency-injection.md Dependency injection with the Azure SDK for .NET

@alexwolfmsft alexwolfmsft marked this pull request as ready for review December 11, 2025 16:35
@alexwolfmsft alexwolfmsft requested review from a team, jsquire and scottaddie as code owners December 11, 2025 16:35
Copilot AI review requested due to automatic review settings December 11, 2025 16:35
Copy link
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 updates the Azure SDK dependency injection code snippets to migrate from the Azure.AI.OpenAI package (version 2.1.0) to the OpenAI package (version 2.7.0). The changes affect multiple example projects demonstrating dependency injection patterns with different application builders.

  • Replaces Azure.AI.OpenAI with OpenAI package and updates client usage patterns
  • Introduces OpenAIResponseClient with BearerTokenPolicy for Azure authentication
  • Adds environment variable validation for AZURE_OPENAI_ENDPOINT

Reviewed changes

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

Show a summary per file
File Description
docs/azure/sdk/snippets/dependency-injection/WebApplicationBuilder/WebApplicationBuilder.csproj Replaces Azure.AI.OpenAI package reference with OpenAI package
docs/azure/sdk/snippets/dependency-injection/WebApplicationBuilder/Program.cs Updates OpenAI client registration to use new OpenAI package with custom authentication
docs/azure/sdk/snippets/dependency-injection/HostBuilder/Program.cs Updates OpenAI client registration to use new OpenAI package with custom authentication
docs/azure/sdk/snippets/dependency-injection/HostBuilder/HostBuilder.csproj Replaces Azure.AI.OpenAI package reference with OpenAI package
docs/azure/sdk/snippets/dependency-injection/HostApplicationBuilder/Program.cs Updates OpenAI client registration to use new OpenAI package with custom authentication
docs/azure/sdk/snippets/dependency-injection/HostApplicationBuilder/HostApplicationBuilder.csproj Replaces Azure.AI.OpenAI package reference with OpenAI package
docs/azure/sdk/snippets/dependency-injection/Directory.Packages.props Updates central package version management from Azure.AI.OpenAI 2.1.0 to OpenAI 2.7.0
docs/azure/sdk/snippets/authentication/Directory.Packages.props Updates central package version management from Azure.AI.OpenAI 2.1.0 to OpenAI 2.7.0

Copy link
Member

@scottaddie scottaddie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes will successfully upgrade the code to use v2.8.0 of the OpenAI package

@alexwolfmsft alexwolfmsft merged commit 15c0a2c into main Dec 12, 2025
11 checks passed
@alexwolfmsft alexwolfmsft deleted the openai-library-updates branch December 12, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants