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

useragent: onboard azure agent #4797

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cli/azd/internal/tracing/fields/fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,10 @@ const (
// Environments that are wrapped by an intermediate calling program, and are significant enough to warrant
// being an environment and not an environment modifier.

EnvVisualStudio = "Visual Studio"
EnvVisualStudioCode = "Visual Studio Code"
EnvCloudShell = "Azure CloudShell"
EnvVisualStudio = "Visual Studio"
EnvVisualStudioCode = "Visual Studio Code"
EnvVSCodeAzureCopilot = "VS Code Azure GitHub Copilot"
EnvCloudShell = "Azure CloudShell"

// Continuous Integration environments

Expand Down
4 changes: 4 additions & 0 deletions cli/azd/internal/tracing/resource/exec_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ func getExecutionEnvironment() string {
func execEnvFromCaller() string {
userAgent := os.Getenv(internal.AzdUserAgentEnvVar)

if strings.Contains(userAgent, internal.VsCodeAzureCopilotAgentPrefix) {
return fields.EnvVSCodeAzureCopilot
}

if strings.Contains(userAgent, internal.VsCodeAgentPrefix) {
return fields.EnvVisualStudioCode
}
Expand Down
2 changes: 2 additions & 0 deletions cli/azd/internal/useragent.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const (
VsCodeAgentPrefix = "vscode:/extensions/ms-azuretools.azure-dev"
// cspell: disable-next-line
VsAgentPrefix = "vside:/webtools/azdev.publish"
// cspell: disable-next-line
VsCodeAzureCopilotAgentPrefix = "ms-azuretools.vscode-azure-github-copilot"
)

// UserAgent() creates the user agent string for azd.
Expand Down
Loading