Fixing the Proxy issue with the PCCRV2 #21384
Open
+142
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
This PR resolves the core issue of socket timeout errors in corporate proxy environments while maintaining full backward compatibility and adding comprehensive security measures.
Customers using the PublishCodeCoverageResultsV2 task in corporate environments with proxy servers were experiencing socket timeout errors when attempting to upload coverage data to Azure blob storage (ufxtcmprodweu21.vstmrblob.vsassets.io:443). This occurred even when the blob storage endpoints were whitelisted in their proxy configuration.
Root Cause: The underlying .NET application (CoveragePublisher.Console) was failing to properly initialize HttpClient.DefaultProxy settings, causing network requests to bypass proxy configuration despite environment variables being set.
Solution Overview
This PR implements a comprehensive proxy configuration system that ensures proper .NET HttpClient proxy initialization by:
Enhanced Proxy Detection: Priority-based proxy configuration (Azure agent → Environment variables)
Comprehensive Environment Variables: Sets both standard and .NET-specific proxy environment variables
Security Hardening: Input validation, credential masking, and secure credential handling
Cross-Platform Support: Handles proxy configuration across Windows, Linux, and macOS
Task Name
PublishCodeCoverageResultsV2
Risk Assessment (Low / Medium / High)
Low
Additional Testing Performed
List all other tests performed (manual or automated, including integration, regression, scenario tests, etc.).
Checklist