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

Azure VSCode extension continuously repeats GitHub authentication

Open Qythyx opened this issue 4 months ago • 10 comments

This is a bit of a complicated issue, so I'll try to explain it.

First, the symptom that I see is in VSCode, when I have the Azure Resources extension installed, it can get into a state where it continuously repeats GitHub authentication. Yes, I know Azure and GitHub are not directly related, but this is what I'm seeing. The messages are shown in the VSCode Output panel for GitHub Authentication, and they look like the following and are repeated continuously.

2025-08-19 16:54:18.347 [info] Getting sessions for all scopes...
2025-08-19 16:54:18.347 [info] Got 5 sessions for ...
2025-08-19 16:54:54.675 [info] Getting sessions for all scopes...
2025-08-19 16:54:54.678 [info] Got 5 sessions for ...
2025-08-19 16:54:54.683 [info] Getting sessions for read:user,repo,user:email,workflow...
2025-08-19 16:54:54.684 [info] Got 1 sessions for read:user,repo,user:email,workflow...

This is a problem because it ends up using the GitHub API, which can expire your rate limit. You can check the usage via a command like curl -H "Authorization: token <GITHUB_PERSONAL_TOKEN>" https://api.github.com/rate_limit. Which shows something like the following (I've excluded the uninteresting bits):

{
  "resources": {
    "core": {
      "limit": 5000,
      "used": 3376,
      "remaining": 1624,
      "reset": 1755591629
    },
    ⠇
    "code_scanning_upload": {
      "limit": 5000,
      "used": 3376,
      "remaining": 1624,
      "reset": 1755591629
    },
    ⠇
  },
  "rate": {
    "limit": 5000,
    "used": 3376,
    "remaining": 1624,
    "reset": 1755591629
  }
}

I've been able to temporarily solve this problem by clicking on the Accounts icon in the bottom-left in VSCode, going to my Microsoft account (the one I use for logging into Azure), and logging out. If I then go to the Azure Resources panel it says I need to Sign in to Azure. If I do that, it logs in successfully and the problem is no longer happening. But, the problem resurfaces at some time later. I'm not sure what causes it to start again. It might be related to opening VSCode on another machine that has settings sync enabled, but I'm not sure that is what causes it to happen again.

I mentioned the Azure Resources extension as a problem, but I believe this may happen with any Azure extension, like Azure Functions, Azure Databases, etc. In fact, I'm not even 100% sure the issue is related to these extensions. It may be entirely related being logged into my Microsoft account.

I also don't know why these Azure extensions have interactions with GitHub authentication. One thing I did notice is that if I go to Account in VSCode, click on my Microsoft account, and then click on Manage Trusted Extensions then a list of trusted extensions is shown, one of which is GitHub Copilot Chat, so this implies at least some connection between this account an GitHub.

Let me know if there is anything I can do to help investigate this problem more.

Qythyx avatar Aug 19 '25 08:08 Qythyx

@charris-msft it seems like this is related to the GitHub Copilot Chat extension. Can you investigate?

alexweininger avatar Aug 19 '25 13:08 alexweininger

@alexweininger - Marcos is oncall this week and will take a look.

charris-msft avatar Aug 19 '25 20:08 charris-msft

@Qythyx Do you have Github Copilot For Azure extension installed?

Image

msalaman avatar Aug 19 '25 22:08 msalaman

@msalaman, no, I do have the basic GitHub Copilot and GitHub Copilot Chat extensions installed, but not the one for Azure.

Qythyx avatar Aug 20 '25 01:08 Qythyx

@alexweininger we only own Github Copilot for Azure extension, we do not have the context to investigate the issue

msalaman avatar Aug 20 '25 16:08 msalaman

I also don't know why these Azure extensions have interactions with GitHub authentication. One thing I did notice is that if I go to Account in VSCode, click on my Microsoft account, and then click on Manage Trusted Extensions then a list of trusted extensions is shown, one of which is GitHub Copilot Chat, so this implies at least some connection between this account an GitHub.

@Qythyx can you share a screenshot of the Manage Trusted Extensions view?

alexweininger avatar Aug 20 '25 18:08 alexweininger

@alexweininger, sure here are 2 screenshots. The first is where the Manage Trusted Extensions is shown (bottom-left if you click on the profile icon). The second is the menu that is show after you click (center-top of the window).

Image Image

Qythyx avatar Aug 22 '25 01:08 Qythyx

@msalaman, do you know who owns the Azure Resources extension or where I could file an issue for it?

Qythyx avatar Aug 22 '25 01:08 Qythyx

@Qythyx are you still facing this issue?

alexweininger avatar Sep 18 '25 19:09 alexweininger

@alexweininger, yes this issue still happens. In addition to the GitHub authentication, the Microsoft authentication also happens continuously with repeated messages like the following:

2025-09-21 10:27:50.690 [info] [getSessions] [6f1cc985-85e8-487e-b0dd-aa633302a731/.default VSCODE_TENANT:organizations] returned 1 session(s)
2025-09-21 10:27:50.690 [info] [getSessions] [VSCODE_TENANT:b5600c92-9581-4bd6-90c5-1c1c96ddc2ff https://management.core.windows.net/.default] starting
2025-09-21 10:27:50.698 [info] [getSessions] [VSCODE_TENANT:b5600c92-9581-4bd6-90c5-1c1c96ddc2ff https://management.core.windows.net/.default] returned 1 session(s)
2025-09-21 10:27:50.698 [info] [getSessions] [https://management.core.windows.net/.default] starting
2025-09-21 10:27:51.051 [info] [getSessions] [https://management.core.windows.net/.default] returned 1 session(s)
2025-09-21 10:27:51.051 [info] [getSessions] [all] starting
2025-09-21 10:27:51.051 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:51.051 [info] [getSessions] [all] starting
2025-09-21 10:27:51.051 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:51.051 [info] [getSessions] [all] starting
2025-09-21 10:27:51.051 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:51.051 [info] [getSessions] [all] starting
2025-09-21 10:27:51.051 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:51.051 [info] [getSessions] [all] starting
2025-09-21 10:27:51.051 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:51.052 [info] [getSessions] [https://management.azure.com/.default] starting
2025-09-21 10:27:51.507 [info] [getSessions] [https://management.azure.com/.default] returned 1 session(s)
2025-09-21 10:27:51.507 [info] [getSessions] [499b84ac-1321-427f-aa17-267ca6975798/.default offline_access] starting
2025-09-21 10:27:51.837 [info] [getSessions] [499b84ac-1321-427f-aa17-267ca6975798/.default offline_access] returned 1 session(s)
2025-09-21 10:27:51.837 [info] [getSessions] [all] starting
2025-09-21 10:27:51.837 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:51.837 [info] [getSessions] [all] starting
2025-09-21 10:27:51.837 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:51.838 [info] [getSessions] [all] starting
2025-09-21 10:27:51.838 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:51.838 [info] [getSessions] [VSCODE_TENANT:organizations] starting
2025-09-21 10:27:52.223 [info] [getSessions] [VSCODE_TENANT:organizations] returned 1 session(s)
2025-09-21 10:27:52.223 [info] [getSessions] [all] starting
2025-09-21 10:27:52.223 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:52.223 [info] [getSessions] [all] starting
2025-09-21 10:27:52.224 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:52.224 [info] [getSessions] [all] starting
2025-09-21 10:27:52.224 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:52.224 [info] [getSessions] [https://management.core.windows.net/.default] starting
2025-09-21 10:27:52.566 [info] [getSessions] [https://management.core.windows.net/.default] returned 1 session(s)
2025-09-21 10:27:52.566 [info] [getSessions] [all] starting
2025-09-21 10:27:52.566 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:52.566 [info] [getSessions] [all] starting
2025-09-21 10:27:52.567 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:52.567 [info] [getSessions] [all] starting
2025-09-21 10:27:52.567 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:52.567 [info] [getSessions] [all] starting
2025-09-21 10:27:52.567 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:52.567 [info] [getSessions] [https://management.azure.com/.default] starting
2025-09-21 10:27:52.948 [info] [getSessions] [https://management.azure.com/.default] returned 1 session(s)
2025-09-21 10:27:52.948 [info] [getSessions] [499b84ac-1321-427f-aa17-267ca6975798/.default offline_access] starting
2025-09-21 10:27:53.305 [info] [getSessions] [499b84ac-1321-427f-aa17-267ca6975798/.default offline_access] returned 1 session(s)
2025-09-21 10:27:53.305 [info] [getSessions] [all] starting
2025-09-21 10:27:53.305 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:53.305 [info] [getSessions] [all] starting
2025-09-21 10:27:53.305 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:53.305 [info] [getSessions] [6f1cc985-85e8-487e-b0dd-aa633302a731/.default VSCODE_TENANT:organizations] starting
2025-09-21 10:27:54.054 [info] [getSessions] [6f1cc985-85e8-487e-b0dd-aa633302a731/.default VSCODE_TENANT:organizations] returned 1 session(s)
2025-09-21 10:27:54.054 [info] [getSessions] [all] starting
2025-09-21 10:27:54.054 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:54.054 [info] [getSessions] [VSCODE_TENANT:organizations] starting
2025-09-21 10:27:54.862 [info] [getSessions] [VSCODE_TENANT:organizations] returned 1 session(s)
2025-09-21 10:27:54.862 [info] [getSessions] [all] starting
2025-09-21 10:27:54.862 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:54.862 [info] [getSessions] [all] starting
2025-09-21 10:27:54.862 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:54.862 [info] [getSessions] [https://management.core.windows.net/.default] starting
2025-09-21 10:27:55.268 [info] [getSessions] [https://management.core.windows.net/.default] returned 1 session(s)
2025-09-21 10:27:55.268 [info] [getSessions] [all] starting
2025-09-21 10:27:55.268 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:55.268 [info] [getSessions] [all] starting
2025-09-21 10:27:55.268 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:55.268 [info] [getSessions] [all] starting
2025-09-21 10:27:55.268 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:55.268 [info] [getSessions] [all] starting
2025-09-21 10:27:55.268 [info] [getSessions] [all] returned 1 session(s)
2025-09-21 10:27:55.268 [info] [getSessions] [all] starting
2025-09-21 10:27:55.268 [info] [getSessions] [all] returned 1 session(s)

Qythyx avatar Sep 21 '25 01:09 Qythyx