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

Azure for Students: Cannot list subscriptions - only see "Select Subscriptions" after logging into Azure #797

Open
saragibby opened this issue May 4, 2023 · 17 comments

Comments

@saragibby
Copy link

saragibby commented May 4, 2023

Description

I'm on the Microsoft Audience Advocacy team where we work with students and those new to tech. While working with students we found the when using the Azure Resources VS Code extension to log into Azure with their Azure for Students account to deploy a resource, they will only see "Select Subscription". With no subscriptions listed to seelect, despite having an "Azure for Students" subscription tied to their account.

So far, we have encountered this only in Codespaces and vscode.dev. VS Code running locally will display the "Azure for Students" subscription in the list after logging into Azure.

Screenshots of the same GitHub account, GitHub repo and Azure for students account across all 3 editors:

vscode.dev

With "Failed to refresh access token" message at bottom:
image

Codespaces

With "Failed to refresh access token" message at bottom:
image (1)

VS Code running locally

image (2)

Impact

Currently preventing us for working with students on scenarios deploying to Azure from Codesapces and vscode.dev, as our typically first step to introduce Azure is through a VS Code deployment or connection.

VS Code Version:

vscode.dev

image

Codespaces

image

VS Code locally

image

Version / Account

  • Azure Account Extension Version: 0.11.4 (note: for only Codespaces and VS Code locally)
  • Azure Resources Extension Version: 0.7.1
  • OS Version: Windows 11 Enterprise

Does your account belong to more than one directory? (see your directories here):

Any other information about your Azure account that may be useful: Happening across all Azure for Students accounts that we tested, and many regular Azure accounts

Reproducing

This also happened during a line Reactor event with @juliamuiruri4. Recording can be found here to follow exact steps we took - https://www.youtube.com/live/85HHu5KGYUM?feature=share&t=2284
The only thing not included was logging into GitHub and Azure portal in the private browser before the session started.

@saragibby
Copy link
Author

saragibby commented May 30, 2023

UPDATE

Bug is still occurring in both Codespaces and vscode.dev when logging in with Azure for Students account using the with following updated versions:

  • Azure Account Extension Version: 0.12.1
  • Azure Resources Extension Version: 0.7.5
  • vscode.dev: 1.78.2

@alexweininger let me know if there is anything I can do to help with this one. Be great to get our students unblocked. Thanks!

@fiveisprime
Copy link
Member

Is there a reason why subscriptions are hidden until clicked in the web experience? That happens for my account as well so maybe just showing the full list would avoid this issue altogether?

@alexweininger
Copy link
Member

@saragibby Can you share the logs from the Microsoft Authentication Output channel after you encounter the error? Make sure to redact any PII.

image

@alexweininger
Copy link
Member

alexweininger commented May 30, 2023

Is there a reason why subscriptions are hidden until clicked in the web experience? That happens for my account as well so maybe just showing the full list would avoid this issue altogether?

@fiveisprime Are you forced to select subscriptions every time you open the web experience? If so, that sounds like a different issue, unrelated to Azure for Students.

@alexweininger alexweininger changed the title Cannot list subscriptions - only see "Select Subscriptions" after logging into Azure Azure for Students: Cannot list subscriptions - only see "Select Subscriptions" after logging into Azure May 30, 2023
@alexweininger
Copy link
Member

I can reproduce this issue and I can see some errors in the Microsoft Authentication log channel. I've attached the logs below.
AzureForStudents.log

@fiveisprime
Copy link
Member

Is there a reason why subscriptions are hidden until clicked in the web experience? That happens for my account as well so maybe just showing the full list would avoid this issue altogether?

@fiveisprime Are you forced to select subscriptions every time you open the web experience? If so, that sounds like a different issue, unrelated to Azure for Students.

Only on the first sign-in. All subsequent sign-ins from the same instance show the subscriptions. But I demo a lot and it's always a new instance so I see it a lot 🫠

@alexweininger
Copy link
Member

Only on the first sign-in. All subsequent sign-ins from the same instance show the subscriptions. But I demo a lot and it's always a new instance so I see it a lot 🫠

What do you mean by new instance? New tab? New browser session?

@fiveisprime
Copy link
Member

New browser session

@saragibby
Copy link
Author

@alexweininger @fiveisprime subscriptions never load, even when clicked. When clicked there is an error in the prompt at bottom right "Failed to refresh access token".

So both in vscode.dev and Codespaces those with Azure for Students accounts are blocked from even getting to Azure, as they hit the error and no subscriptions ever load

The log in both is near identical: vscodedev-codespaces-azure.log

@saragibby
Copy link
Author

@alexweininger
Copy link
Member

@saragibby

I was able to successfully login with my Azure for Students account by clicking on the "Sign in with Microsoft to use Azure Resources (1)" option within the Accounts menu. Can you see if this works for you?

image

@saragibby
Copy link
Author

saragibby commented Jun 2, 2023

@alexweininger I was able to get my subscriptions to load using the "Sign in with Microsoft to use Azure Resources (1)" option.

Here are the steps I followed (using my test student GitHub account and test student Azure account):

  1. Create Codespace for one of my repos (one I used - https://github.com/bgibbons3/my-portfolio)
  2. Sign into Azure using the "Sign in to Azure..." link in the Azure blade ("Sign in with Microsoft to use Azure Resources (1)" option not available until after I signed in)
  3. Click "Select Subscriptions..." in Azure blade, which gives me "Failed to refresh access token" error" and then loads the "Sign in with Microsoft to use Azure Resources (1)" option in the Account menu
  4. Click "Sign in with Microsoft to use Azure Resources (1)" and authenticate a second time
  5. Click "Select Subscriptions..." and then I see my single subscription ("Azure for Students") loads for me to use.

After that, I'm able to view/create/interact with all my Azure resources.

Note: the above steps are the same in vscode.dev and insiders.vscode.dev.

@alexweininger
Copy link
Member

I've verified that this issue is fixed in the current insiders release 1.80.0-insider. Try it out on insiders.vscode.dev

@saragibby
Copy link
Author

Thanks @alexweininger! Verified with my Azure for Students account that I was able to connect to Azure, and select my "Azure for Students" subscription without going through the additional "Sign in with Microsoft to use Azure Resources (1)" link and auth.

Is there a rough idea yet when 1.80.0 will be promoted to production (vscode.dev)?

@alexweininger
Copy link
Member

According to microsoft/vscode#184844 it should be on or around June 30th.

@alexweininger alexweininger added this to the 0.12.0 milestone Jun 22, 2023
@saragibby
Copy link
Author

Update

Tested this with the following extension versions:
Azure Static Web Apps - 12.2.2
Azure Resources - 0.7.5

Was able to connect to my Azure for Students account on Codespaces, and vscode.dev on Chrome.

However, on vscode.dev (1.80.1) and insiders.vscode.dev (1.81.0-insider) I got the same "Failed to refresh access token." error message in the bottom right prompt while using Edge and Brave browsers.

(tag @alexweininger)

@fouchekeagan
Copy link

I'm having the same issue with Mac Ventura 13.2.1, I am signed into Azure with 2 different accounts and it fails to list the subscriptions for the different accounts. I have to sign out and close all IDE instance, then start up and sign in again with the other account, close all instances and then it'll show the new subscription. Super painful and lengthy.

Azure Resource extension version 0.9.5

VS Code details:
Version: 1.93.1 (Universal)
Commit: 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40
Date: 2024-09-11T17:20:05.685Z
Electron: 30.4.0
ElectronBuildId: 10073054
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Darwin arm64 22.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants