diff --git a/sdk/storage/storage-blob/ChangeLog.md b/sdk/storage/storage-blob/ChangeLog.md index 64b15f01640f..0be7f95415af 100644 --- a/sdk/storage/storage-blob/ChangeLog.md +++ b/sdk/storage/storage-blob/ChangeLog.md @@ -1,5 +1,9 @@ # Changelog +## 2019.09 12.0.0-preview.4 + +- Library tries to load the proxy settings from the environment variables like HTTP_PROXY if the proxy settings are not provided when clients like BlobServiceClient or BlobClient are instantiated. + ## 2019.09 12.0.0-preview.3 - [Breaking] `RawTokenCredential` is dropped. TokenCredential implementations can be found in the [@azure/identity](https://www.npmjs.com/package/@azure/identity) library for authentication. diff --git a/sdk/storage/storage-blob/samples/javascript/proxyAuth.js b/sdk/storage/storage-blob/samples/javascript/proxyAuth.js index 8dc4209eb264..6b2003915718 100644 --- a/sdk/storage/storage-blob/samples/javascript/proxyAuth.js +++ b/sdk/storage/storage-blob/samples/javascript/proxyAuth.js @@ -21,6 +21,7 @@ async function main() { // or // an option bag consisting {host, port, username, password } proxy: { host: "http://localhost", port: 3128, username: "username", password: "password" } + // if proxy is undefined, the library tries to load the proxy settings from the environment variables like HTTP_PROXY } ); diff --git a/sdk/storage/storage-blob/samples/typescript/proxyAuth.ts b/sdk/storage/storage-blob/samples/typescript/proxyAuth.ts index 8155b4121106..e5449c1ac83b 100644 --- a/sdk/storage/storage-blob/samples/typescript/proxyAuth.ts +++ b/sdk/storage/storage-blob/samples/typescript/proxyAuth.ts @@ -21,6 +21,7 @@ async function main() { // or // an option bag consisting {host, port, username, password } proxy: { host: "http://localhost", port: 3128, username: "username", password: "password" } + // if proxy is undefined, the library tries to load the proxy settings from the environment variables like HTTP_PROXY } ); diff --git a/sdk/storage/storage-blob/src/Pipeline.ts b/sdk/storage/storage-blob/src/Pipeline.ts index dcee99dcb1d1..ff5c42589952 100644 --- a/sdk/storage/storage-blob/src/Pipeline.ts +++ b/sdk/storage/storage-blob/src/Pipeline.ts @@ -203,7 +203,7 @@ export function newPipeline( if (isNode) { // ProxyPolicy is only avaiable in Node.js runtime, not in browsers let proxySettings: ProxySettings | undefined; - if (typeof pipelineOptions.proxy === "string") { + if (typeof pipelineOptions.proxy === "string" || !pipelineOptions.proxy) { proxySettings = getDefaultProxySettings(pipelineOptions.proxy); } else { proxySettings = pipelineOptions.proxy; diff --git a/sdk/storage/storage-file/ChangeLog.md b/sdk/storage/storage-file/ChangeLog.md index ae9ec2d315a4..b03931b2f07b 100644 --- a/sdk/storage/storage-file/ChangeLog.md +++ b/sdk/storage/storage-file/ChangeLog.md @@ -1,5 +1,9 @@ # Changelog +## 2019.09 12.0.0-preview.4 + +- Library tries to load the proxy settings from the environment variables like HTTP_PROXY if the proxy settings are not provided when clients like FileServiceClient or FileClient are instantiated. + ## 2019.08 12.0.0-preview.3 - Updated Azure Storage Service API version to 2019-02-02. diff --git a/sdk/storage/storage-file/samples/javascript/proxyAuth.js b/sdk/storage/storage-file/samples/javascript/proxyAuth.js index 1432625768f0..520869123d3d 100644 --- a/sdk/storage/storage-file/samples/javascript/proxyAuth.js +++ b/sdk/storage/storage-file/samples/javascript/proxyAuth.js @@ -21,6 +21,7 @@ async function main() { // or // an option bag consisting {host, port, username, password } proxy: { host: "http://localhost", port: 3128, username: "username", password: "password" } + // if proxy is undefined, the library tries to load the proxy settings from the environment variables like HTTP_PROXY } ); diff --git a/sdk/storage/storage-file/samples/typescript/proxyAuth.ts b/sdk/storage/storage-file/samples/typescript/proxyAuth.ts index 4cdd6068a0db..961a7bcc7733 100644 --- a/sdk/storage/storage-file/samples/typescript/proxyAuth.ts +++ b/sdk/storage/storage-file/samples/typescript/proxyAuth.ts @@ -21,6 +21,7 @@ async function main() { // or // an option bag consisting {host, port, username, password } proxy: { host: "http://localhost", port: 3128, username: "username", password: "password" } + // if proxy is undefined, the library tries to load the proxy settings from the environment variables like HTTP_PROXY } ); diff --git a/sdk/storage/storage-file/src/Pipeline.ts b/sdk/storage/storage-file/src/Pipeline.ts index 61d1eec38cc2..e95b5f158723 100644 --- a/sdk/storage/storage-file/src/Pipeline.ts +++ b/sdk/storage/storage-file/src/Pipeline.ts @@ -196,7 +196,7 @@ export function newPipeline( if (isNode) { // ProxyPolicy is only avaiable in Node.js runtime, not in browsers let proxySettings: ProxySettings | undefined; - if (typeof pipelineOptions.proxy === "string") { + if (typeof pipelineOptions.proxy === "string" || !pipelineOptions.proxy) { proxySettings = getDefaultProxySettings(pipelineOptions.proxy); } else { proxySettings = pipelineOptions.proxy; diff --git a/sdk/storage/storage-queue/ChangeLog.md b/sdk/storage/storage-queue/ChangeLog.md index a4a8b6b7eed4..6d63f32a46ca 100644 --- a/sdk/storage/storage-queue/ChangeLog.md +++ b/sdk/storage/storage-queue/ChangeLog.md @@ -1,5 +1,9 @@ # Changelog +## 2019.09 12.0.0-preview.4 + +- Library tries to load the proxy settings from the environment variables like HTTP_PROXY if the proxy settings are not provided when clients like QueueServiceClient or QueueClient are instantiated. + ## 2019.08 12.0.0-preview.3 - [Breaking] `RawTokenCredential` is dropped. TokenCredential implementations can be found in the [@azure/identity](https://www.npmjs.com/package/@azure/identity) library for authentication. diff --git a/sdk/storage/storage-queue/samples/javascript/proxyAuth.js b/sdk/storage/storage-queue/samples/javascript/proxyAuth.js index f1307f99ac29..eca72ca78229 100644 --- a/sdk/storage/storage-queue/samples/javascript/proxyAuth.js +++ b/sdk/storage/storage-queue/samples/javascript/proxyAuth.js @@ -21,6 +21,7 @@ async function main() { // or // an option bag consisting {host, port, username, password } proxy: { host: "http://localhost", port: 3128, username: "username", password: "password" } + // if proxy is undefined, the library tries to load the proxy settings from the environment variables like HTTP_PROXY } ); diff --git a/sdk/storage/storage-queue/samples/typescript/proxyAuth.ts b/sdk/storage/storage-queue/samples/typescript/proxyAuth.ts index 0ab67e6c712b..cc4d9d6e41dd 100644 --- a/sdk/storage/storage-queue/samples/typescript/proxyAuth.ts +++ b/sdk/storage/storage-queue/samples/typescript/proxyAuth.ts @@ -21,6 +21,7 @@ async function main() { // or // an option bag consisting {host, port, username, password } proxy: { host: "http://localhost", port: 3128, username: "username", password: "password" } + // if proxy is undefined, the library tries to load the proxy settings from the environment variables like HTTP_PROXY } ); diff --git a/sdk/storage/storage-queue/src/Pipeline.ts b/sdk/storage/storage-queue/src/Pipeline.ts index acf6bd897a40..888045a6e73b 100644 --- a/sdk/storage/storage-queue/src/Pipeline.ts +++ b/sdk/storage/storage-queue/src/Pipeline.ts @@ -204,7 +204,7 @@ export function newPipeline( if (isNode) { // ProxyPolicy is only avaiable in Node.js runtime, not in browsers let proxySettings: ProxySettings | undefined; - if (typeof pipelineOptions.proxy === "string") { + if (typeof pipelineOptions.proxy === "string" || !pipelineOptions.proxy) { proxySettings = getDefaultProxySettings(pipelineOptions.proxy); } else { proxySettings = pipelineOptions.proxy;