0.10.0 and 0.9.11 get VisualStudioCodeCredential mixed
Azure account extension: 0.9.11 Sign in an account.
Now I update to Azure account extension: 0.10.0
My account has been removed; I must sign in again. Now I sign in another account (not the account I signed in for 0.9.11). And I use identity.VisualStudioCodeCredential(tenantId) to get credential for SqlServer, but the credential is 0.9.11 login account not 0.10.0 account. How can I get a credential of 0.10.0 account now?
Reproduction steps:
1.Install 0.9.11 Azure account extension.
2.Signin account1 via Azure account extension.
3.Use identity.VisualStudioCodeCredential(tenantId) to get token for SqlServer. Now I can get a token of account1.
4.Update Azure account extension to 0.10.0.
5.My account has been removed; I sign in account2 via Azure account extension.
6.Use identity.VisualStudioCodeCredential(tenantId) to get token for SqlServer. Now I still get a token of account1, not account2 token.
Related: https://github.com/microsoft/vscode-azure-account/issues/443
Thanks for the detailed repro steps, @xiaolang124. For now please downgrade to version 0.9.11 of the extension (steps shown here) to workaround this problem.
This is happening because v0.9.11 stores cache entries under the category VS Code Azure and VisualStudioCodeCredential reads from the cache directly looking for a specific cache key. The problem is: in v0.10.0 we started consuming VS Code's SecretStorage API which handles cache key names for us so the cache stored with that old key was not updated when you signed in using v0.10.0. For more info see https://github.com/microsoft/vscode-azure-account/issues/443#issuecomment-1048018144
Hi @wwlorey, Would you tell me is there any plan when this will be fixed? Whether it will be automatically fixed in next version?
@xzf0587 the team is working on a long-term fix for this. We'll update the thread when it's available.
@wwlorey I found the azure account extension has updated to 0.11.0. Is this problem fixed in the new version?