Skip to content
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
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "azure",
"description": "Microsoft Azure MCP and Skills integration for cloud resource management, deployments, and Azure services. Manage your Azure infrastructure, monitor applications, and deploy resources directly from Claude Code.",
"version": "1.2.80",
"version": "1.2.82",
"author": {
"name": "Microsoft",
"url": "https://www.microsoft.com"
Expand Down
2 changes: 1 addition & 1 deletion .github/plugins/azure-cost/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "azure-cost",
"description": "Azure cost analysis, estimation, optimization, and governance workflows backed by Azure Resource Manager MCP.",
"version": "1.0.5",
"version": "1.0.6",
"author": {
"name": "Microsoft",
"url": "https://www.microsoft.com"
Expand Down
2 changes: 1 addition & 1 deletion .github/plugins/azure-cost/.cursor-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "azure-cost",
"description": "Azure cost analysis, estimation, optimization, and governance workflows backed by Azure Resource Manager MCP.",
"version": "1.0.5",
"version": "1.0.6",
"author": {
"name": "Microsoft",
"url": "https://www.microsoft.com"
Expand Down
2 changes: 1 addition & 1 deletion .github/plugins/azure-cost/.plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "azure-cost",
"description": "Azure cost analysis, estimation, optimization, and governance workflows backed by Azure Resource Manager MCP.",
"version": "1.0.5",
"version": "1.0.6",
"author": {
"name": "Microsoft",
"url": "https://www.microsoft.com"
Expand Down
4 changes: 4 additions & 0 deletions .github/plugins/azure-cost/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.0.6

- fix: clarify telemetry publisher debug logs ([#3336](https://github.com/microsoft/GitHub-Copilot-for-Azure/pull/3336))

## 1.0.5

- chore: add telemetry disclosure for azure-cost plugin ([#3296](https://github.com/microsoft/GitHub-Copilot-for-Azure/pull/3296))
Expand Down
44 changes: 31 additions & 13 deletions .github/plugins/azure-cost/hooks/scripts/track-telemetry.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Telemetry tracking hook for Azure Copilot Skills
# Reads JSON input from stdin, tracks relevant events, and publishes via MCP
# Reads JSON input from stdin, tracks relevant events, and publishes telemetry
# Exit codes: 0 = hook continues, including telemetry failures
#
# === Client Format Reference ===
#
Expand Down Expand Up @@ -123,8 +124,9 @@
#
# If the AZURE_SKILLS_TELEMETRY_LOG_DIR env var is set, the script will create
# a "raw-input" subdirectory and write each raw JSON input to a timestamped file
# for debugging. It will also append a "telemetry.log" file with MCP args for
# each tracked event.
# for debugging. It will also append a "telemetry.log" file identifying the
# publisher and arguments for each tracked event, the standalone version and
# executable path, and publisher installation/execution failures.
#
# When using `--plugin-dir` to load a local plugin the AZURE_SKILLS_PLUGIN_ROOT
# env var should be set so that the script can detect local skill paths for
Expand Down Expand Up @@ -555,6 +557,9 @@ if ($shouldTrack) {
if ($filePath) { $mcpArgs += "--file-reference"; $mcpArgs += ($filePath -replace '/', '\') }

if ($env:AZURE_SKILLS_USE_STANDALONE_TELEMETRY -eq "true") {
$publisher = "Standalone ghcfa-telem (version $telemetryReporterVersion)"
$reporterArguments = $mcpArgs[2..($mcpArgs.Count - 1)]
Write-TelemetryDebugLog -Content "Publisher: $publisher | Args: $($reporterArguments -join ' ')"
$installerPath = Join-Path $scriptDir 'install-telemetry.ps1'
$powerShellExecutable = (Get-Process -Id $PID).Path
$installerArguments = @(
Expand All @@ -570,34 +575,47 @@ if ($shouldTrack) {
$installerArguments += '-Version'
$installerArguments += $telemetryReporterVersion

$installerOutput = @(& $powerShellExecutable @installerArguments 2>&1)
# Capture installer stderr without changing the hook's fail-open error preference.
$installerOutput = @(& {
$ErrorActionPreference = 'Continue'
& $powerShellExecutable @installerArguments 2>&1
})
$installerStatus = $LASTEXITCODE
if ($installerStatus -eq 0 -and $installerOutput.Count -gt 0) {
if ($installerStatus -eq 0 -and $installerOutput.Count -gt 0 -and
-not [string]::IsNullOrWhiteSpace([string]$installerOutput[-1])) {
$reporterPath = [string]$installerOutput[-1]
$reporterArguments = $mcpArgs[2..($mcpArgs.Count - 1)]
Write-TelemetryDebugLog -Content "Publisher: $publisher | Executable: $reporterPath"
try {
& $reporterPath @reporterArguments 2>&1 | Out-Null
$reporterStatus = $LASTEXITCODE
if ($reporterStatus -ne 0) {
Write-TelemetryDebugLog -Content "Standalone telemetry reporter exited with status $reporterStatus."
Write-TelemetryDebugLog -Content "Publisher: $publisher | Execution failed with status $reporterStatus."
}
} catch {
Write-TelemetryDebugLog -Content "Standalone telemetry reporter failed: $($_.Exception.Message)"
Write-TelemetryDebugLog -Content "Publisher: $publisher | Execution failed to start."
}
}
elseif ($installerStatus -eq 0) {
Write-TelemetryDebugLog -Content "Publisher: $publisher | Installation failed: installer returned no executable path."
}
else {
Write-TelemetryDebugLog -Content "Standalone telemetry reporter installation failed: $($installerOutput -join ' ')"
Write-TelemetryDebugLog -Content "Publisher: $publisher | Installation failed with status ${installerStatus}: $($installerOutput -join ' ')"
}
}
else {
# Preserve the existing publisher unless the standalone path is explicitly enabled.
$publisher = "Azure MCP (npx -y @azure/mcp@latest)"
Write-TelemetryDebugLog -Content "Publisher: $publisher | Args: $($mcpArgs -join ' ')"
try {
& npx -y @azure/mcp@latest @mcpArgs 2>&1 | Out-Null
} catch { }
$publisherStatus = $LASTEXITCODE
if ($publisherStatus -ne 0) {
Write-TelemetryDebugLog -Content "Publisher: $publisher | Execution failed with status $publisherStatus."
}
} catch {
Write-TelemetryDebugLog -Content "Publisher: $publisher | Execution failed to start."
}
}

# If AZURE_SKILLS_TELEMETRY_LOG_DIR env var is set, append the args to the telemetry.log file in that directory (for debugging)
Write-TelemetryDebugLog -Content "MCP Args: $($mcpArgs -join ' ')"
}

# Output success to stdout (required by hooks)
Expand Down
31 changes: 20 additions & 11 deletions .github/plugins/azure-cost/hooks/scripts/track-telemetry.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash

# Telemetry tracking hook for Azure Copilot Skills
# Reads JSON input from stdin, tracks relevant events, and publishes via MCP
# Reads JSON input from stdin, tracks relevant events, and publishes telemetry
# Exit codes: 0 = hook continues, including telemetry failures
#
# === Client Format Reference ===
#
Expand Down Expand Up @@ -125,8 +126,9 @@
#
# If the AZURE_SKILLS_TELEMETRY_LOG_DIR env var is set, the script will create
# a "raw-input" subdirectory and write each raw JSON input to a timestamped file
# for debugging. It will also append a "telemetry.log" file with MCP args for
# each tracked event.
# for debugging. It will also append a "telemetry.log" file identifying the
# publisher and arguments for each tracked event, the standalone version and
# executable path, and publisher installation/execution failures.
#
# When using `--plugin-dir` to load a local plugin the AZURE_SKILLS_PLUGIN_ROOT
# env var should be set so that the script can detect local skill paths for
Expand Down Expand Up @@ -483,7 +485,7 @@ if [ -z "$filePath" ] && [ -z "$skillName" ]; then
fi
fi

# === STEP 3: Publish event via azmcp ===
# === STEP 3: Publish event ===

if [ "$shouldTrack" = true ]; then
# The plugin-telemetry command requires a session ID for session_start events.
Expand Down Expand Up @@ -516,29 +518,36 @@ if [ "$shouldTrack" = true ]; then
[ -n "$filePath" ] && mcpArgs+=("--file-reference" "$(echo "$filePath" | tr '/' '\\')")

if [ "${AZURE_SKILLS_USE_STANDALONE_TELEMETRY:-}" = "true" ]; then
publisher="Standalone ghcfa-telem (version $TELEMETRY_REPORTER_VERSION)"
write_telemetry_debug_log "Publisher: $publisher | Args: ${mcpArgs[*]:2}"
installerOutput="$(
bash "$SCRIPT_DIR/install-telemetry.sh" \
--version "$TELEMETRY_REPORTER_VERSION" 2>&1
)"
installerStatus=$?

if [ "$installerStatus" -eq 0 ] && [ -n "$installerOutput" ]; then
write_telemetry_debug_log "Publisher: $publisher | Executable: $installerOutput"
"$installerOutput" "${mcpArgs[@]:2}" >/dev/null 2>&1
reporterStatus=$?
if [ "$reporterStatus" -ne 0 ]; then
write_telemetry_debug_log "Standalone telemetry reporter exited with status $reporterStatus."
write_telemetry_debug_log "Publisher: $publisher | Execution failed with status $reporterStatus."
fi
elif [ "$installerStatus" -eq 0 ]; then
write_telemetry_debug_log "Publisher: $publisher | Installation failed: installer returned no executable path."
else
write_telemetry_debug_log "Standalone telemetry reporter installation failed: $installerOutput"
write_telemetry_debug_log "Publisher: $publisher | Installation failed with status $installerStatus: $installerOutput"
fi
else
# Preserve the existing publisher unless the standalone path is explicitly enabled.
npx -y @azure/mcp@latest "${mcpArgs[@]}" >/dev/null 2>&1 || true
publisher="Azure MCP (npx -y @azure/mcp@latest)"
write_telemetry_debug_log "Publisher: $publisher | Args: ${mcpArgs[*]}"
npx -y @azure/mcp@latest "${mcpArgs[@]}" >/dev/null 2>&1
publisherStatus=$?
if [ "$publisherStatus" -ne 0 ]; then
write_telemetry_debug_log "Publisher: $publisher | Execution failed with status $publisherStatus."
fi
fi

# If AZURE_SKILLS_TELEMETRY_LOG_DIR env var is set, append the args to the
# telemetry.log file in that directory (for debugging)
write_telemetry_debug_log "MCP Args: ${mcpArgs[*]}"
fi

# Output success to stdout (required by hooks)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "azure-kusto-graph-skills",
"description": "Kusto graph analysis, IRQL security hunting pipelines, and graph visualization skills for Azure Data Explorer.",
"version": "1.0.21",
"version": "1.0.22",
"author": {
"name": "Microsoft",
"url": "https://www.microsoft.com"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "azure-kusto-graph-skills",
"description": "Kusto graph analysis, IRQL security hunting pipelines, and graph visualization skills for Azure Data Explorer.",
"version": "1.0.21",
"version": "1.0.22",
"author": {
"name": "Microsoft",
"url": "https://www.microsoft.com"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "azure-kusto-graph-skills",
"description": "Kusto graph analysis, IRQL security hunting pipelines, and graph visualization skills for Azure Data Explorer.",
"version": "1.0.21",
"version": "1.0.22",
"author": {
"name": "Microsoft",
"url": "https://www.microsoft.com"
Expand Down
4 changes: 4 additions & 0 deletions .github/plugins/azure-kusto-graph-skills/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.0.22

- fix: clarify telemetry publisher debug logs ([#3336](https://github.com/microsoft/GitHub-Copilot-for-Azure/pull/3336))

## 1.0.21

- misc: add telemetry disclosure to Kusto Graph plugin ([#3304](https://github.com/microsoft/GitHub-Copilot-for-Azure/pull/3304))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Telemetry tracking hook for Azure Copilot Skills
# Reads JSON input from stdin, tracks relevant events, and publishes via MCP
# Reads JSON input from stdin, tracks relevant events, and publishes telemetry
# Exit codes: 0 = hook continues, including telemetry failures
#
# === Client Format Reference ===
#
Expand Down Expand Up @@ -123,8 +124,9 @@
#
# If the AZURE_SKILLS_TELEMETRY_LOG_DIR env var is set, the script will create
# a "raw-input" subdirectory and write each raw JSON input to a timestamped file
# for debugging. It will also append a "telemetry.log" file with MCP args for
# each tracked event.
# for debugging. It will also append a "telemetry.log" file identifying the
# publisher and arguments for each tracked event, the standalone version and
# executable path, and publisher installation/execution failures.
#
# When using `--plugin-dir` to load a local plugin the AZURE_SKILLS_PLUGIN_ROOT
# env var should be set so that the script can detect local skill paths for
Expand Down Expand Up @@ -555,6 +557,9 @@ if ($shouldTrack) {
if ($filePath) { $mcpArgs += "--file-reference"; $mcpArgs += ($filePath -replace '/', '\') }

if ($env:AZURE_SKILLS_USE_STANDALONE_TELEMETRY -eq "true") {
$publisher = "Standalone ghcfa-telem (version $telemetryReporterVersion)"
$reporterArguments = $mcpArgs[2..($mcpArgs.Count - 1)]
Write-TelemetryDebugLog -Content "Publisher: $publisher | Args: $($reporterArguments -join ' ')"
$installerPath = Join-Path $scriptDir 'install-telemetry.ps1'
$powerShellExecutable = (Get-Process -Id $PID).Path
$installerArguments = @(
Expand All @@ -570,34 +575,47 @@ if ($shouldTrack) {
$installerArguments += '-Version'
$installerArguments += $telemetryReporterVersion

$installerOutput = @(& $powerShellExecutable @installerArguments 2>&1)
# Capture installer stderr without changing the hook's fail-open error preference.
$installerOutput = @(& {
$ErrorActionPreference = 'Continue'
& $powerShellExecutable @installerArguments 2>&1
})
$installerStatus = $LASTEXITCODE
if ($installerStatus -eq 0 -and $installerOutput.Count -gt 0) {
if ($installerStatus -eq 0 -and $installerOutput.Count -gt 0 -and
-not [string]::IsNullOrWhiteSpace([string]$installerOutput[-1])) {
$reporterPath = [string]$installerOutput[-1]
$reporterArguments = $mcpArgs[2..($mcpArgs.Count - 1)]
Write-TelemetryDebugLog -Content "Publisher: $publisher | Executable: $reporterPath"
try {
& $reporterPath @reporterArguments 2>&1 | Out-Null
$reporterStatus = $LASTEXITCODE
if ($reporterStatus -ne 0) {
Write-TelemetryDebugLog -Content "Standalone telemetry reporter exited with status $reporterStatus."
Write-TelemetryDebugLog -Content "Publisher: $publisher | Execution failed with status $reporterStatus."
}
} catch {
Write-TelemetryDebugLog -Content "Standalone telemetry reporter failed: $($_.Exception.Message)"
Write-TelemetryDebugLog -Content "Publisher: $publisher | Execution failed to start."
}
}
elseif ($installerStatus -eq 0) {
Write-TelemetryDebugLog -Content "Publisher: $publisher | Installation failed: installer returned no executable path."
}
else {
Write-TelemetryDebugLog -Content "Standalone telemetry reporter installation failed: $($installerOutput -join ' ')"
Write-TelemetryDebugLog -Content "Publisher: $publisher | Installation failed with status ${installerStatus}: $($installerOutput -join ' ')"
}
}
else {
# Preserve the existing publisher unless the standalone path is explicitly enabled.
$publisher = "Azure MCP (npx -y @azure/mcp@latest)"
Write-TelemetryDebugLog -Content "Publisher: $publisher | Args: $($mcpArgs -join ' ')"
try {
& npx -y @azure/mcp@latest @mcpArgs 2>&1 | Out-Null
} catch { }
$publisherStatus = $LASTEXITCODE
if ($publisherStatus -ne 0) {
Write-TelemetryDebugLog -Content "Publisher: $publisher | Execution failed with status $publisherStatus."
}
} catch {
Write-TelemetryDebugLog -Content "Publisher: $publisher | Execution failed to start."
}
}

# If AZURE_SKILLS_TELEMETRY_LOG_DIR env var is set, append the args to the telemetry.log file in that directory (for debugging)
Write-TelemetryDebugLog -Content "MCP Args: $($mcpArgs -join ' ')"
}

# Output success to stdout (required by hooks)
Expand Down
Loading
Loading