Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to .NET 9.0 and update Azure SDK, SK and other packages #394

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

elbruno
Copy link
Collaborator

@elbruno elbruno commented Feb 24, 2025

Purpose

  • Upgraded project from .NET 8.0 to .NET 9.0 across multiple files, including Directory.Packages.props, SharedWebComponents.csproj, MinimalApi.csproj, ClientApp.csproj, and various test projects.
  • Updated several Azure-related packages to newer versions, such as Azure.AI.OpenAI, Azure.Extensions.AspNetCore.Configuration.Secrets, and Azure.Identity.
  • Modified the Dockerfile to use .NET 9.0 base images for both runtime and build stages.
  • Replaced OpenAIClient with AzureOpenAIClient for improved functionality with Azure OpenAI services.
  • Updated methods for generating embeddings and chat completions to align with new client methods.
  • Adjusted test files to ensure compatibility with the updated framework and client.
  • Added XML configuration for SDK resolver settings to manage SDK versions and paths.

Does this introduce a breaking change?

[X] Yes
[ ] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[X] Feature
[X] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

DETAILS

- Upgraded project from .NET 8.0 to .NET 9.0 across multiple files, including `Directory.Packages.props`, `SharedWebComponents.csproj`, `MinimalApi.csproj`, `ClientApp.csproj`, and various test projects.
- Updated several Azure-related packages to newer versions, such as `Azure.AI.OpenAI`, `Azure.Extensions.AspNetCore.Configuration.Secrets`, and `Azure.Identity`.
- Modified the Dockerfile to use .NET 9.0 base images for both runtime and build stages.
- Replaced `OpenAIClient` with `AzureOpenAIClient` for improved functionality with Azure OpenAI services.
- Updated methods for generating embeddings and chat completions to align with new client methods.
- Adjusted test files to ensure compatibility with the updated framework and client.
- Added XML configuration for SDK resolver settings to manage SDK versions and paths.
Copy link
Collaborator

@luisquintanilla luisquintanilla left a comment

Choose a reason for hiding this comment

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

Thanks @elbruno. LGTM. Just one minor comment.

var embedding = embeddings.Value.Data.FirstOrDefault()?.Embedding.ToArray() ?? [];
var embeddingsClient = openAIClient.GetEmbeddingClient(embeddingModelName);
var embeddings = await embeddingsClient.GenerateEmbeddingAsync(input: section.Content.Replace('\r', ' '));
var embedding = embeddings.Value.ToFloats(); // .Value.Data.FirstOrDefault()?.Embedding.ToArray() ?? [];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the comment at the end of this needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, that was part of the package upgrade tests, deleted the unused comment.

@luisquintanilla
Copy link
Collaborator

Also, I think you might need to update GHA to use .NET 9 as well. I think that's why the build is failing.

@elbruno
Copy link
Collaborator Author

elbruno commented Feb 25, 2025

GHA

Yes, let me upgrade the actions files to use .NET 9

@@ -16,7 +16,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
Copy link
Collaborator Author

@elbruno elbruno Feb 25, 2025

Choose a reason for hiding this comment

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

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.

2 participants