Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to log in to Azure Account #25367

Open
npasken opened this issue Feb 21, 2024 · 9 comments
Open

Unable to log in to Azure Account #25367

npasken opened this issue Feb 21, 2024 · 9 comments

Comments

@npasken
Copy link

npasken commented Feb 21, 2024

Type: Bug

  1. Launch Azure Data Studio
  2. Try to add Azure Account using Device Code flow
  3. Get following errors:
[Error]: Error fetching tenants :TypeError: Cannot use 'in' operator to search for 'error' in invalid_request: Your request could not be processed.
[Error]: Login failed: TypeError: Cannot use 'in' operator to search for 'error' in invalid_request: Your request could not be processed.

Azure Data Studio version: azuredatastudio 1.47.1 (b6f7beb, 2024-01-10T02:15:02.628Z)
OS version: Windows_NT x64 10.0.22621
Restricted Mode: No
Preview Features: Enabled
Modes:

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (8 x 2995)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 39.69GB (21.34GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (3)
Extension Author (truncated) Version
copilot Git 1.95.239
azuredatastudio-mysql Mic 1.0.0
query-history Mic 0.5.3
Copy link

We need more info to debug your Microsoft Entra ID issue. If you could attach your logs to the issue (ensure no private data is in them), it would help us fix the issue much faster.

  • In the settings menu, find the setting titled Azure: Logging Level and select the Verbose option
  • Restart Azure Data Studio
  • Run the process that produces your error
  • Open command palette (Click View -> Command Palette)
  • Run the command: Developer: Open Logs Folder
  • Follow this path to find the Azure Accounts log file: [default log folder]/window1/exthost/output_logging_[earliest timestamp]/#-Azure Accounts.log
  • Please attach the Azure-Accounts.log file to the issue.

Additionally, please review known issues and their resolutions that could be helpful: Common Azure Authentication Issues

@npasken
Copy link
Author

npasken commented Feb 21, 2024

1-Azure Accounts.log

As requested - file is attached.

@cheenamalhotra
Copy link
Member

it seems the request is going invalid for this case, even though it works in most cases. I will add more logging so we can understand better what is going wrong.

@npasken
Copy link
Author

npasken commented Feb 26, 2024

it seems the request is going invalid for this case, even though it works in most cases. I will add more logging so we can understand better what is going wrong.

I'm a rather new user to ADS, but if it is supposed to be similar to VS Code, I don't have any issues logging in to my account in VS Code. Not sure if that's helpful, but figured I'd mention. And I tried using the Auth code grant flow and get the same error.

@calebcartwright
Copy link

We've got people running into this as well and it's hindering progress on some key initiatives.

Is there a feature branch anywhere that's got that aforementioned extra logging that we could use to build and run locally to try to get to the source of the error? We've had our AAD admins check on the AAD side and everything looks correct and successful there, but on the Data Studio client side the underlying Type Error that's occurring due to this 👇 call site:

if (isErrorResponseBodyWithError(data)) {

is completely swallowing whatever the underlying issue is because the call arg is clearly not an object the in operator can be used against

@cheenamalhotra
Copy link
Member

cheenamalhotra commented Feb 27, 2024

There hasn't been any churn in this area recently, the request made to acquire tenants itself is failing, which is surprising.

Can you enable PII logging using below setting, restart ADS and rerun the failing scenario. You can find logs in "Azure Accounts" Output pane or in the log file as per above comment, something like under.

image

[Verbose]: Fetching tenants with uri: https://management.azure.com/tenants?api-version=2019-11-01 - []
[Pii]: GET request  response=<<<this is where you will find detailed error information>>>

Just paste the error from the response above, you need not share the complete log file. Please mask any sensitive info and paste detailed error as available.

We will address the 'in' operator bug in future iterations.

@calebcartwright
Copy link

We've got an open Service Request with Microsoft. Would it be better for us to share masked content here in public or the full log in private on the request?

@calebcartwright
Copy link

The details we have from the PII log are below. They do not strike me as particularly illuminating but hopefully it offers something meaningful to you 🤷

The response is an object with a set of single digit stringified keys, each of which has a single character string as the value.

There's no data key

[Pii]: GET request response={"0":"B","1":"a","2":"d","3":" ", ...elided... } - ["https://management.azure.com/tenants?api-version=2019-11-01"]
[Error]: Error fetching tenants :TypeError: Cannot use 'in' operator to search for 'error' in Bad request - []
[Error]: Login failed: TypeError: Cannot use 'in' operator to search for 'error' in Bad request - []

@JF-SR
Copy link

JF-SR commented Mar 15, 2024

Hi. I am experiencing exactly the same problem. Have tried adding/removing proxy but makes no difference. Azure authentication reports success in the browser but then always fails here:
[Verbose]: Fetching tenants with uri: https://management.azure.com/tenants?api-version=2019-11-01 - []
[Error]: Error fetching tenants :TypeError: Cannot use 'in' operator to search for 'error' in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs triage
Development

No branches or pull requests

5 participants