microsoft / vscode-azureresourcegroups

VS Code extension for managing Azure resources.
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureresourcegroups
MIT License
50 stars 28 forks source link

New Azure subscription, fails to refresh access token #681

Open douglasstarnes opened 1 year ago

douglasstarnes commented 1 year ago

I have a new Azure subscription and I want to demo it using GitHub Codespaces. However, when I try to sign in with the Azure Resources extension, the only item in the sidebar bar is "Select Subscription". If I click on that, an error shows in the popup that says "Failed to refresh access token". However, if I try to access the same subscription using Visual Studio Code, it works.

savannahostrowski commented 1 year ago

I also just ran into this issue in Codespaces

image

alexweininger commented 1 year ago

@douglasstarnes Just to clarify, are you using GitHub CodeSpaces or github.dev or vscode.dev?

Does reloading the window help at all?

douglasstarnes commented 1 year ago

@alexweininger Nope. I've tried reinstalling the extension, logging out and back in, and creating a new Codespace several times. And I'm using GitHub CodeSpaces on github.com.

jazzcat commented 1 year ago

@douglasstarnes

Same experience here after installing the extension (Codespaces on GitHub.com or vscode.dev) and logging into my MS account:

two

As it turns out, after logging into your MS account, you'll need to grant additional access to your Azure resources:

one

Once that's been done, you should be all set:

three

alexweininger commented 1 year ago

@jazzcat, thanks for reporting the workaround. I can confirm that we are working to fix having to do the additional grant automatically.

Related to/duplicate of https://github.com/microsoft/vscode-azure-account/issues/797. I will leave this open for now until this is fixed.

douglasstarnes commented 1 year ago

Thanks @jazzcat I can confirm that this works. It didn't use to be this way. Also, I would add that to see the Grant Access to Microsoft for Azure Resources option you must first click on Select Subscription in the Azure Tool pane and let that fail. Then you will see the option to grant access and it will work.

alexweininger commented 1 year ago

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