microsoft / vscode-azure-account

Common Azure Login extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account
Other
139 stars 129 forks source link

"You appear to be offline. Please check your network connection." Error when trying to log into Azure behind corporate proxy. #147

Closed ColumCross closed 5 years ago

ColumCross commented 5 years ago

I am having the same issue as https://github.com/microsoft/vscode-azure-account/issues/121 however, I have been told by @chrmarti to open a new issue.

I tried setting up my proxy settings with the following part in my settings.json: {"http.proxy": "[my proxy]", "http.proxySupport": "on"}

I am using the following versions of the extensions: Azure Account: 0.8.4 Azure App Service: 0.15.0

My VS Code Version: Version: 1.37.1 (user setup) Date: 2019-08-15T16:17:55.855Z Electron: 4.2.7 Chrome: 69.0.3497.128 Node.js: 10.11.0 V8: 6.9.427.31-electron.0 OS: Windows_NT x64 10.0.17134

My VS Code Insider Version: Version: 1.38.0-insider (user setup) Date: 2019-08-21T13:26:22.457Z Electron: 4.2.9 Chrome: 69.0.3497.128 Node.js: 10.11.0 V8: 6.9.427.31-electron.0 OS: Windows_NT x64 10.0.17134

I am not receiving any errors in the console in Developer Tools.

chrmarti commented 5 years ago

Could you retry with proxy support set to "override"?

ColumCross commented 5 years ago

Changing the setting to "http.proxySupport": "override" had no effect.

chrmarti commented 5 years ago

Could you:

ColumCross commented 5 years ago

I received the following information from the log on both the standard and Insider editions: [2019-08-23 09:38:16.085] [exthost] [trace] ProxyResolver#resolveProxy settings https://dc.services.visualstudio.com/api/profiles/[MY APP ID]/appId PROXY [MY PROXY] [2019-08-23 09:38:19.610] [exthost] [trace] ExtHostCommands#$executeContributedCommand _vscode_delegate_cmd_jzo5ssfr [2019-08-23 09:38:19.610] [exthost] [trace] ExtHostCommands#executeCommand azure-account.login [2019-08-23 09:38:19.611] [exthost] [trace] ProxyResolver#resolveProxy settings https://login.microsoftonline.com/ PROXY [MY PROXY] [2019-08-23 09:38:19.785] [exthost] [trace] ExtHostCommands#$executeContributedCommand _vscode_delegate_cmd_jzo5ssfr [2019-08-23 09:38:19.785] [exthost] [trace] ExtHostCommands#executeCommand azure-account.login [2019-08-23 09:38:19.786] [exthost] [trace] ProxyResolver#resolveProxy settings https://login.microsoftonline.com/ PROXY [MY PROXY] [2019-08-23 09:38:21.611] [exthost] [trace] ProxyResolver#resolveProxy settings https://login.microsoftonline.com/ PROXY [MY PROXY] [2019-08-23 09:38:21.787] [exthost] [trace] ProxyResolver#resolveProxy settings https://login.microsoftonline.com/ PROXY [MY PROXY] [2019-08-23 09:38:23.611] [exthost] [trace] ProxyResolver#resolveProxy settings https://login.microsoftonline.com/ PROXY [MY PROXY] [2019-08-23 09:38:23.789] [exthost] [trace] ProxyResolver#resolveProxy settings https://login.microsoftonline.com/ PROXY [MY PROXY] [2019-08-23 09:38:25.613] [exthost] [trace] ProxyResolver#resolveProxy settings https://login.microsoftonline.com/ PROXY [MY PROXY] [2019-08-23 09:38:25.790] [exthost] [trace] ProxyResolver#resolveProxy settings https://login.microsoftonline.com/ PROXY [MY PROXY] [2019-08-23 09:38:27.613] [exthost] [trace] ProxyResolver#resolveProxy settings https://login.microsoftonline.com/ PROXY [MY PROXY] [2019-08-23 09:38:27.789] [exthost] [trace] ProxyResolver#resolveProxy settings https://login.microsoftonline.com/ PROXY [MY PROXY] [2019-08-23 09:38:29.613] [exthost] [trace] ProxyResolver#resolveProxy settings https://login.microsoftonline.com/ PROXY [MY PROXY] [2019-08-23 09:38:29.789] [exthost] [trace] ProxyResolver#resolveProxy settings https://login.microsoftonline.com/ PROXY [MY PROXY] [2019-08-23 09:38:31.082] [exthost] [trace] ProxyResolver#resolveProxy settings https://vortex.data.microsoft.com/collect/v1 PROXY [MY PROXY] [2019-08-23 09:38:31.113] [exthost] [trace] ProxyResolver#resolveProxy settings https://vortex.data.microsoft.com/collect/v1 PROXY [MY PROXY] [2019-08-23 09:38:31.614] [exthost] [trace] ProxyResolver#resolveProxy settings https://login.microsoftonline.com/ PROXY [MY PROXY] [2019-08-23 09:38:31.796] [exthost] [trace] ProxyResolver#resolveProxy settings https://login.microsoftonline.com/ PROXY [MY PROXY] [2019-08-23 09:38:33.615] [exthost] [trace] ProxyResolver#resolveProxy settings https://login.microsoftonline.com/ PROXY [MY PROXY]

The last line kept repeating long after I had closed the "You appear to be offline." pop up.

Here's the line you asked for isolated, so it might be easier to read (it's also the one that kept repeating): [2019-08-23 09:38:27.613] [exthost] [trace] ProxyResolver#resolveProxy settings https://login.microsoftonline.com/ PROXY [MY PROXY]

chrmarti commented 5 years ago

I'm adding some more logging to better understand what is going on.

Could you check what you get for nslookup login.microsoftonline.com on the command line?

ColumCross commented 5 years ago

Thank you for your help and timely feedback so far. I talked to my team and we have traced this back to another related login.microsoftonline.com issue. Can we take this to a private conversation, so we can talk more about more about my company's specific issue? Thank you.

chrmarti commented 5 years ago

Sure, you can contact me at chrmarti at microsoft dot com.

chrmarti commented 5 years ago

That issue does not sound familiar (checked by email). Do you have a proxy certificate installed on your local machine? Does turning on / off the System Certificates support in the VS Code settings change anything?

ColumCross commented 5 years ago

We do have proxy certificates installed on our machines. Changing the setting you suggested did not change anything. What exactly does that setting do? And what exactly does turning it off do (or is supposed to do)?

chrmarti commented 5 years ago

Normally Node.js (and Electron) does not load the certificates registered in the OS, but comes with a baked-in list of certificates. When the setting is enabled we do load the certificates from the OS ourselves to support custom certificates like in your case.

I forgot: When you turn it off, you need to reload the VS Code window to make that change effective. (Turning it back on doesn't need that.)

ColumCross commented 5 years ago

I just tested again in both the standard and Insider versions of Code. Toggling the setting had no effect. I have left the setting to on in both versions for now.

We believe the issue talked about in the email may have something to do with the connection timing out. Does this extension have a timeout when trying to connect to login.microsoftonline.com? If so, how long is it set to currently?

chrmarti commented 5 years ago

The timeout should be 2 minutes.

ColumCross commented 5 years ago

As discussed via email, this issue is related to a different Microsoft issue and not specifically VS Code or this extension. Therefore, I am closing this ticket.

jeremy-brooks commented 4 years ago

Well what was the MS issue then?

paul4156 commented 4 years ago

I am having this issue too. Please re-open this. Thanks.

prabhushrikant commented 3 years ago

I am seeing this issue too, what's the root cause?

douglasg-cheops commented 3 years ago

I am seeing this same issue with the same results showing up in my tracing.

TimMarshAU commented 2 years ago

Same issue. Device code login behind the proxy, authenticate, "logged in, close the browser" and VS Code does not sign in to Azure.

What is the MS issue?

frahe-ama commented 1 year ago

Having the same problem (behind company firewall). A similar problem exists with logging in to Azure cloud services with other tools. There it could be resolved by adding the necessary root certificates to trust. But here ist doesn't seem to be possible. From my point of view this could be (hopefully) a solution. But I don't know where or how to register these certificates.

TimMarshAU commented 1 year ago

Same issue. Device code login behind the proxy, authenticate, "logged in, close the browser" and VS Code does not sign in to Azure.

What is the MS issue?

I found that by tunnelling the Azure/MSFT endpoints we were able to get the login working properly.

GP4cK commented 1 year ago

This comment fixed it for me: https://github.com/microsoft/vscode-azure-account/issues/733#issuecomment-1468239088

kevinblumenfeld commented 1 year ago

This issue should be reopened. I too am having this issue: https://github.com/microsoft/vscode-azure-account/issues/745#issuecomment-1479963996

dm-grinko commented 1 year ago

+1

bpwc commented 1 month ago

+1