Skip to content

Add user-agent policy to fine-tuning extension HTTP clients for request tracing#6923

Merged
saanikaguptamicrosoft merged 5 commits intoAzure:mainfrom
saanikaguptamicrosoft:saanika/useragent
Mar 2, 2026
Merged

Add user-agent policy to fine-tuning extension HTTP clients for request tracing#6923
saanikaguptamicrosoft merged 5 commits intoAzure:mainfrom
saanikaguptamicrosoft:saanika/useragent

Conversation

@saanikaguptamicrosoft
Copy link
Collaborator

@saanikaguptamicrosoft saanikaguptamicrosoft commented Feb 27, 2026

Notes

  • Added azd-ext-azure-ai-finetune/<version> user-agent to all outgoing API calls (OpenAI + ARM)
  • Extracted internal/version package (previously version vars lived in internal/cmd), and accordingly updated ldflags paths in build scripts.
  • To resolve transitive dependency of armappservice/v2, ran-
    • go get github.com/azure/azure-dev/cli/azd/pkg/azsdk
    • go mod tidy

Testing

  • azd x build — builds successfully
  • All UTs pass

Copilot AI review requested due to automatic review settings February 27, 2026 13:07
@saanikaguptamicrosoft saanikaguptamicrosoft changed the title Saanika/useragent Add user-agent policy to fine-tuning extension HTTP clients for request tracing Feb 27, 2026
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 introduces build-time version metadata for the azure.ai.finetune extension and uses it to set a custom User-Agent on outbound HTTP calls (OpenAI + ARM), alongside required dependency and build-script updates.

Changes:

  • Added internal/version package to hold build-injected Version/Commit/BuildDate, and updated the version command + build scripts to use it.
  • Added an azsdk.NewUserAgentPolicy(...) to Azure SDK pipelines used by the OpenAI middleware and ARM client factory.
  • Updated go.mod/go.sum to newer Azure SDK / azd / related transitive dependencies (notably azcore to support azcore/arm).

Reviewed changes

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

Show a summary per file
File Description
cli/azd/extensions/azure.ai.finetune/internal/version/version.go New package for build-time version metadata variables.
cli/azd/extensions/azure.ai.finetune/internal/providers/factory/provider_factory.go Builds a User-Agent string from version info and injects it into Azure SDK pipelines / ARM client options.
cli/azd/extensions/azure.ai.finetune/internal/cmd/version.go Switches version command output to read from internal/version.
cli/azd/extensions/azure.ai.finetune/go.mod Bumps dependencies to support new imports/policies.
cli/azd/extensions/azure.ai.finetune/go.sum Updated dependency checksums for the bumped modules.
cli/azd/extensions/azure.ai.finetune/ci-build.ps1 Updates ldflags to inject version metadata into internal/version.
cli/azd/extensions/azure.ai.finetune/build.sh Updates ldflags injection target package path to internal/version.
cli/azd/extensions/azure.ai.finetune/build.ps1 Updates ldflags injection target package path to internal/version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@saanikaguptamicrosoft saanikaguptamicrosoft merged commit c1879fa into Azure:main Mar 2, 2026
19 checks passed
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.

4 participants