vscode-azure-account icon indicating copy to clipboard operation
vscode-azure-account copied to clipboard

Can't sign in on version 0.11.0

Open 72gm opened this issue 3 years ago • 3 comments

Click the "sign in to Azure" under resources in VS Code New window pops up saying you are now signed in and can close this screen Close screen and nothing has happened in VS Code "sign in to Azure" still being shown

This worked fine until version 0.11.0

Reverting to version 0.10.1 solves the problem

72gm avatar Jul 12 '22 15:07 72gm

Things to try:

  1. Using version 0.11.0, does trying sign-in two times fix the issue? Some users have reported that they need to sign in twice to get it working.
  2. What is the value of the azure.authenticationLibrary setting? Try switching to MSAL or ADAL and retrying sign-in.

image

Questions:

  1. When you switched to version 0.10.1, were you asked to sign in again?
  2. Are you using a proxy of any kind?
  3. What email domain is associated with your Azure account? (ex: hotmail.com, gmail.com)

alexweininger avatar Jul 12 '22 20:07 alexweininger

Things to try:

  1. Using version 0.11.0, does trying sign-in two times fix the issue? Some users have reported that they need to sign in twice to get it working.

no, doesn't matter how many times

  1. What is the value of the azure.authenticationLibrary setting? Try switching to MSAL or ADAL and retrying sign-in.

currently ADAL

image

Questions:

  1. When you switched to version 0.10.1, were you asked to sign in again? Yes
  2. Are you using a proxy of any kind? At work so yes I'd imagine so
  3. What email domain is associated with your Azure account? (ex: hotmail.com, gmail.com) work domain

72gm avatar Jul 13 '22 08:07 72gm

Proxies tend to cause a lot of issues with Azure sign-in with the extension. Our troubleshooting section in our wiki could provide help Troubleshooting: Unable to sign in while using a proxy

alexweininger avatar Jul 13 '22 22:07 alexweininger

This didn't work for me.

jg572h avatar Jan 25 '23 21:01 jg572h

This didn't work for me.

Just in case: make sure you complete close and restart the VS Code process after adding changing the environment variable.

alexweininger avatar Jan 25 '23 21:01 alexweininger

Yes, I did that. The NO_PROXY variable even shows up when listing the environment in a Terminal window.

In case this helps, here is what appears in the output channel:

Attempting to reach URL "https://login.microsoftonline.com/"...
Attempting to reach URL "https://login.microsoftonline.com/"...
Attempting to reach URL "https://vscode.dev/redirect"...
Attempting to reach URL "https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id=aebc6443-996d-45c2-90f0-388ff96faa56&redirect_uri=https%3A%2F%2Fvscode.dev%2Fredirect&state=http%3A%2F%2F127.0.0.1%3A61478%2Fcallback?nonce=CMjhHiQ7%2BR3FOL8FxD9TUw%3D%3D&prompt=select_account"...
Wed, 25 Jan 2023 22:19:14 GMT:a7729026-9901-48e0-bc18-f1d8739ccd9f - OAuth2Client: ERROR: No response from the server
Stack:
Error: No response from the server
	at Logger.createError (c:\Users\jg572h\.vscode\extensions\ms-vscode.azure-account-0.11.3\dist\extension.bundle.js:2:865070)
	at c:\Users\jg572h\.vscode\extensions\ms-vscode.azure-account-0.11.3\dist\extension.bundle.js:2:878103
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: No response from the server
No response from the server

I noticed that the advice in the troubleshooting link suggested adding login.microsoft.com to the NO_PROXY variable, but I see that the extension is actually trying to reach login.microsoftonline.com. So, I tried adding login.microsoftonline.com to the NO_PROXY variable, and this time it tried for about 30 seconds before failing. Here is the log output from that attempt:

Attempting to reach URL "https://login.microsoftonline.com/"...
Attempting to reach URL "https://login.microsoftonline.com/"...
Attempting to reach URL "https://vscode.dev/redirect"...
Attempting to reach URL "https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id=aebc6443-996d-45c2-90f0-388ff96faa56&redirect_uri=https%3A%2F%2Fvscode.dev%2Fredirect&state=http%3A%2F%2F127.0.0.1%3A56550%2Fcallback?nonce=2t0JDIuBoOv2b3jaKTqAow%3D%3D&prompt=select_account"...
request to https://management.azure.com/tenants?api-version=2016-06-01 failed, reason: tunneling socket could not be established, statusCode=403
Attempting to reach URL "https://login.microsoftonline.com/"...
Attempting to reach URL "https://vscode.dev/redirect"...
Attempting to reach URL "https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id=aebc6443-996d-45c2-90f0-388ff96faa56&redirect_uri=https%3A%2F%2Fvscode.dev%2Fredirect&state=http%3A%2F%2F127.0.0.1%3A56593%2Fcallback?nonce=uUzlh%2FA3IeFA3lQTuj0VMQ%3D%3D&prompt=select_account"...
request to https://management.azure.com/tenants?api-version=2016-06-01 failed, reason: tunneling socket could not be established, statusCode=403
Attempting to reach URL "https://login.microsoftonline.com/"...
Attempting to reach URL "https://vscode.dev/redirect"...
Attempting to reach URL "https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id=aebc6443-996d-45c2-90f0-388ff96faa56&redirect_uri=https%3A%2F%2Fvscode.dev%2Fredirect&state=http%3A%2F%2F127.0.0.1%3A56174%2Fcallback?nonce=I2K7%2Bf9EnbY7oLthZbULAA%3D%3D&prompt=select_account"...
request to https://management.azure.com/tenants?api-version=2016-06-01 failed, reason: tunneling socket could not be established, statusCode=403

Getting closer maybe?

jg572h avatar Jan 25 '23 22:01 jg572h

@jg572h A bit embarrassing, but I made a typo on the page that explains the workaround. The hostname to add to the NO_PROXY environment variable should be login.microsoftonline.com and NOT login.microsoft.com. Sorry about that, but please let me know if that fixes it.

alexweininger avatar Jan 26 '23 23:01 alexweininger

@alexweininger Thanks for the response. I added login.microsoftonline.com to the NO_PROXY environment variable, and it definitely gets further than before, but still does not connect. Here's the output I see in the output channel:

Attempting to reach URL "https://login.microsoftonline.com/"...
Attempting to reach URL "https://login.microsoftonline.com/"...
Attempting to reach URL "https://vscode.dev/redirect"...
Attempting to reach URL "https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id=aebc6443-996d-45c2-90f0-388ff96faa56&redirect_uri=https%3A%2F%2Fvscode.dev%2Fredirect&state=http%3A%2F%2F127.0.0.1%3A55115%2Fcallback?nonce=oML6qxh6lID6NKYHkF3vPw%3D%3D&prompt=select_account"...
request to https://management.azure.com/tenants?api-version=2016-06-01 failed, reason: tunneling socket could not be established, statusCode=403

The funny thing about this is that a week ago, it did connect, and I was able to see my Azure Kubernetes clusters. Since then I've installed the Azure CLI and Azure PowerShell tools, and since then it hasn't connected. I tried uninstalling the Azure tools (and even reinstalling the VS Code extension), but to no avail. Not sure what to try next. Hope some of this helps to provide a clue.

jg572h avatar Jan 27 '23 15:01 jg572h

@jg572h it looks like the requests to login.microsoftonline.com are now working. And now the request to management.azure.com aren't able to make it through the proxy.

You can try adding management.azure.com to the NO_PROXY environment variable as well. I would try that for a workaround. However, since both hosts are being blocked by the proxy, it sounds like something that could be fixed by making changes to the proxy server configuration.

alexweininger avatar Jan 27 '23 19:01 alexweininger

Hi @72gm and @jg572h, we've created two development builds with proposed fixes for proxy issues. It would be a huge help if you could test these. #714 contains details and instructions on how to do so.

alexweininger avatar Feb 06 '23 22:02 alexweininger

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

AzCode-Bot avatar Feb 21 '23 05:02 AzCode-Bot