vscode-azureresourcegroups icon indicating copy to clipboard operation
vscode-azureresourcegroups copied to clipboard

New Azure subscription, fails to refresh access token

Open douglasstarnes opened this issue 2 years ago • 7 comments

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.

douglasstarnes avatar May 16 '23 15:05 douglasstarnes

I also just ran into this issue in Codespaces

image

savannahostrowski avatar May 16 '23 18:05 savannahostrowski

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

Does reloading the window help at all?

alexweininger avatar May 16 '23 20:05 alexweininger

@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.

douglasstarnes avatar May 16 '23 20:05 douglasstarnes

@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

jazzcat avatar Jun 08 '23 17:06 jazzcat

@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.

alexweininger avatar Jun 08 '23 20:06 alexweininger

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.

douglasstarnes avatar Jun 09 '23 13:06 douglasstarnes

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

alexweininger avatar Jun 13 '23 22:06 alexweininger