Skip to content

Commit

Permalink
onboard azure agent
Browse files Browse the repository at this point in the history
  • Loading branch information
weikanglim committed Feb 14, 2025
1 parent 1125811 commit 8221dc8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
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

0 comments on commit 8221dc8

Please sign in to comment.