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

Azure Account (Extension): You appear to be offline. Please check your network connection. #836

Open Praneeth46 opened 1 year ago

Praneeth46 commented 1 year ago

Does this occur consistently? Yes Repro steps:

  1. In VSCode after having Azure Account extension installed go to Azure Extension
  2. In remote resources tab click on Sign in to Azure.

Action: azure-account.loginToCloud Error type: AzureLoginError Error Message: Offline

Version: 0.11.5 OS: win32 OS Release: 10.0.19045 Product: Visual Studio Code Product Version: 1.76.0 Language: en

Call Stack ``` extension.bundle.js:2:2542818extension.bundle.js:2:2542818 ```
alexweininger commented 1 year ago

Are you behind a proxy of any kind? Proxies often cause issues with sign-in. See the Unable to Sign In While Using a Proxy section of our wiki for possible fixes.

Also, see the Enable and View Logs section of the wiki for how to capture and share Azure Account extension logs.

Praneeth46 commented 1 year ago

Yeah, I am using a CORP VPN and I have updated my VSCode to 1.80.1 and have referred to that article and try all those mentioned.

  1. Adding login.microsoftonline.com to my NO_PROXY environment variable which didn't solve the issue.
  2. And I installed Network Proxy Test extension, and it says: ""

Sending GET request to https://login.microsoftonline.com/... vscode-proxy-agent: DIRECT Received error: certificate has expired (CERT_HAS_EXPIRED) Retrying while ignoring certificate issues to collect information on the certificate chain.

Sending GET request to https://login.microsoftonline.com/ (allowing unauthorized) ... vscode-proxy-agent: DIRECT Received response:

  1. And I tried Azure: Sign in with Device Code but it also resulted in same error as "You appear to be offline. Please check your network connection"

  2. I am using v0.11.5 of Azure Account extension and the logs say "" [info] Attempting to reach URL "https://login.microsoftonline.com/"... [error] certificate has expired "".

johnborges commented 11 months ago

@Praneeth46 Did you ever resolve this. I'm having the same issue with the extension only. Running az login from my terminal works fine.

alexweininger commented 11 months ago

@johnborges are you also using a proxy?

johnborges commented 11 months ago

@alexweininger At the moment yes. But I see the same error when at home off proxy network.

vscode: Version: 1.83.0

Extension Author (truncated) Version
ng-template Ang 16.1.8
network-proxy-test chr 0.0.8
copilot Git 1.122.462
copilot-chat Git 0.8.0
vscode-todo-highlight jgc 2.0.8
azure-pipelines ms- 1.228.0
vscode-docker ms- 1.26.1
csharp ms- 2.5.30
vscode-dotnet-runtime ms- 1.8.0
vscode-edge-devtools ms- 2.1.3
data-workspace-vscode ms- 0.5.0
mssql ms- 1.21.0
sql-bindings-vscode ms- 0.4.0
sql-database-projects-vscode ms- 1.3.1
azure-account ms- 0.11.5
vsliveshare ms- 1.0.5883
vscode-yaml red 1.14.0

ms-teams-vscode-extension

Note: Make sure to replace all sensitive information with dummy values before sharing this output.

VS Code 1.83.0 (e7e037083ff4455cf320e344325dacb480062c3c)
Network Proxy Test 0.0.8
darwin 22.6.0 arm64

Settings:
- http.proxy: 
- http.proxyAuthorization: null
- http.proxyStrictSSL: true
- http.proxySupport: override
- http.systemCertificates: true

Environment variables:

Sending GET request to https://login.microsoftonline.com...
Received error: certificate has expired (CERT_HAS_EXPIRED)
Retrying while ignoring certificate issues to collect information on the certificate chain.

Sending GET request to https://login.microsoftonline.com (allowing unauthorized)...
Received response:
- Status: 302 Found
- Location: https://www.office.com/login#
chrmarti commented 11 months ago

@johnborges The Network Proxy Test's output should include information about the certificate chain. That would most likely show which certificate has expired. This is usually a certificate from the proxy.

johnborges commented 11 months ago

@chrmarti This is the full output from my network proxy test:

VS Code 1.83.0 (e7e037083ff4455cf320e344325dacb480062c3c)
Network Proxy Test 0.0.8
darwin 22.6.0 arm64

Settings:
- http.proxy: 
- http.proxyAuthorization: null
- http.proxyStrictSSL: true
- http.proxySupport: override
- http.systemCertificates: true

Environment variables:

Sending GET request to https://login.microsoftonline.com...
Received error: certificate has expired (CERT_HAS_EXPIRED)
Retrying while ignoring certificate issues to collect information on the certificate chain.

Sending GET request to https://login.microsoftonline.com (allowing unauthorized)...
Received response:
- Status: 302 Found
- Location: https://www.office.com/login#
Certificate chain:
- Subject: stamp2.login.microsoftonline.com (Microsoft Corporation)
  Subject alt: DNS:stamp2.login.microsoftonline.com, DNS:login.microsoftonline-int.com, DNS:login.microsoftonline-p.com, DNS:login.microsoftonline.com, DNS:login2.microsoftonline-int.com, DNS:login2.microsoftonline.com, DNS:loginex.microsoftonline-int.com, DNS:loginex.microsoftonline.com, DNS:stamp2.login.microsoftonline-int.com
  Validity: Aug 17 00:00:00 2023 GMT - Aug 17 23:59:59 2024 GMT
  Fingerprint: 18:FD:F0:0D:2F:07:9F:33:A3:A9:EF:71:02:C9:29:85:AA:EE:01:4E
- Subject: DigiCert SHA2 Secure Server CA (DigiCert Inc)
  Validity: Sep 23 00:00:00 2020 GMT - Sep 22 23:59:59 2030 GMT
  Fingerprint: 62:6D:44:E7:04:D1:CE:AB:E3:BF:0D:53:39:74:64:AC:80:80:14:2C
- Subject: DigiCert Global Root CA (DigiCert Inc)
  Validity: Nov 10 00:00:00 2006 GMT - Nov 10 00:00:00 2031 GMT
  Fingerprint: A8:98:5D:3A:65:E5:E5:C4:B2:D7:D6:6D:40:C6:DD:2F:B1:9C:54:36
  Self-signed
Local root certificates:
- Subject: C=US O=DigiCert Inc OU=www.digicert.com CN=DigiCert Global Root CA
  Validity: Nov 10 00:00:00 2006 GMT - Nov 10 00:00:00 2031 GMT
  Fingerprint: A8:98:5D:3A:65:E5:E5:C4:B2:D7:D6:6D:40:C6:DD:2F:B1:9C:54:36
  Issuer: C=US O=DigiCert Inc OU=www.digicert.com CN=DigiCert Global Root CA
johnborges commented 11 months ago

@chrmarti Is there something else I can do to troubleshoot this further? I'm able to login to Azure via all possible channels except this extension.