bradygaster-zz / azure-tools-vscode

azure tools extension for visual studio code
Apache License 2.0
29 stars 10 forks source link

Failed to run azure login #30

Closed guhuajun closed 7 years ago

guhuajun commented 7 years ago

Repro Steps

  1. Press Ctrl + Shift + P, type login, choose Azure: Login, press Enter.

default

legobytes commented 7 years ago

The Azure: login fails for me also if I'm behind the corporate proxy. I do have the proxy defined in the settings file. Any solution for this?

bradygaster-zz commented 7 years ago

@legobytes i don't know about the proxy question (totally the wrong guy to ask about "networkese") but i have a first question - are you logging in using a Microsoft Account like @outlook.com, @live.com, or @hotmail.com? If you are there's a first step you need to complete that's documented in the release announcement on my blog and in the extension's page.

legobytes commented 7 years ago

If you are referring to having the tenant ID set, yes I have this set in the settings file.

The extension works fine for me from home (like right now), but I can't get it to login when I'm on the corporate network. I'm fairly certain that this is related to the proxy. I did a wireshark capture, but couldn't find anything useful from that data. We only allow the standard ports of 80 and 443 through the proxy, but I didn't see any requests to other ports (but I could have missed them). Do you know if you use any other ports?

If there is any other debug information I can gather that would assist, please let me know.

Sam

legobytes commented 7 years ago

@bradygaster

I found to a way to get this to work. Not sure if this is a workaround for a bug, or somehow the way it's expected to work.

Instead of defining the proxy in the vscode settings file, I defined the proxy with environment variables.

I can login as expected with this configuration.

Sam

bradygaster-zz commented 7 years ago

That's interesting. Mind if I share this issue with the code team and discuss with them? My presumption is that given the TS/JS nature of VS Code, maybe it relies more on the env vars for proxy configuration. I presume if this is evident there must be other implications. I'd be interested to hear what they'd have to say and if there's any existing guidance here.

legobytes commented 7 years ago

Turns out that using environment variables did not resolve all the issues. I was able to login, but I still couldn't download a template. I'm guessing this is because some of the tools are still not proxy aware. I was able to verify that it was not trying to use the proxy server, it was trying to connect directly. I will see if I can get more specific information to report on the part that is still failing.

bradygaster-zz commented 7 years ago

@legobytes thanks for the info @legobytes. any other info you could provide would be helpful. can you search for a template? the template search & download is all via the GitHub API and not hitting Azure. (just fyi)

bradygaster-zz commented 7 years ago

@legobytes closing due to lack of response. also not sure this is something the extension alone could resolve, but would probably take a higher-level configuration setting to resolve.