Honor VS Code proxy settings in storage data-plane clients#1530
Draft
alexweininger wants to merge 2 commits into
Draft
Honor VS Code proxy settings in storage data-plane clients#1530alexweininger wants to merge 2 commits into
alexweininger wants to merge 2 commits into
Conversation
The @azure/storage-blob, -file-share, and -queue SDKs do not read VS Code's http.proxy / http.noProxy settings on their own, so data-plane operations fail on corporate networks that require an explicit proxy for outbound traffic. Add a small withProxyOptions() helper that resolves proxy configuration via the shared getProxySettings() from @microsoft/vscode-azext-azureutils and merges it into each service client's StoragePipelineOptions. Wire it into the Blob, File, and Queue clients in StorageAccountTreeItem plus the Blob client in BlobContainerFS. Table (@azure/data-tables) does not expose proxyOptions and is deferred. proxyStrictSSL:false is likewise not expressible through proxyOptions. Related to #1527 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
getDataLakeClients constructs DataLakeServiceClient and DataLakePathClient, which is the code path for hierarchical-namespace (Data Lake Gen2) accounts. These were left unproxied while the sibling blob client was wired, so file-system operations on HNS accounts would still fail behind a corporate proxy. Wire both through withProxyOptions, mirroring the blob path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
On networks that require an explicit HTTP proxy for outbound traffic (common in corporate/SSL-inspection environments), storage data-plane operations fail. The
@azure/storage-blob,@azure/storage-file-share, and@azure/storage-queueSDKs only consult the standard proxy environment variables via their built-in pipeline; they never read VS Code'shttp.proxy/http.noProxysettings. So a user who has configured a proxy in VS Code (but not in their environment) can browse resources via ARM yet cannot list blobs, files, or queues.Related to #1527.
Change
src/utils/proxyUtils.tswith a smallwithProxyOptions(endpointUrl, options?)helper. It resolves proxy configuration through the sharedgetProxySettings()exported from@microsoft/vscode-azext-azureutilsand merges the resultingproxyOptionsinto a client'sStoragePipelineOptions. When no proxy applies to the endpoint (host matched byhttp.noProxy/NO_PROXY, or proxy support disabled), it returns the options unchanged.StorageAccountTreeItem(both shared-key and token paths) and the Blob client inBlobContainerFS.getProxySettings()honorshttp.proxy(withHTTPS_PROXY/ALL_PROXY/HTTP_PROXYas fallback),http.noProxy(union withNO_PROXY), andhttp.proxySupport: 'off'as a full opt-out. This mirrors the shared ARM-side fix in microsoft/vscode-azuretools#2356.Scope / follow-ups
@azure/data-tables) does not exposeproxyOptions, soTableServiceClientis intentionally left out and deferred.proxyStrictSSL: falseis not expressible throughproxyOptions(the SDK builds its own proxy agent). CA trust remains covered byNODE_EXTRA_CA_CERTSas documented in the troubleshooting sections.Dependency
Important
This depends on
getProxySettings()from@microsoft/vscode-azext-azureutils4.3.0, added in microsoft/vscode-azuretools#2356. Kept as a draft until that publishes;package.jsonis bumped to^4.3.0.