-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
-
Package Name: @azure/identity
-
Package Version: 1.3.0
-
Operating system: macOS Big Sur 11.1
-
nodejs
- version: 14.16.0
-
browser
- name/version:
-
typescript
- version:
-
Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://docs.microsoft.com
Describe the bug
I'm trying to retrieve credentials from my vscode extension. I'm logged in and can see all my subscriptions.
In the README documentation it says that It should be enough to just be logged in, in docs online it's unclear if I actually need to provide environment variables for it to work.
I run the following code:
const credentials = new DefaultAzureCredential()
console.log(credentials)And it returns:
{
"UnavailableMessage": "DefaultAzureCredential => failed to retrieve a token from the included credentials",
"_sources": [
{},
{
"isEndpointUnavailable": null,
"identityClient": {
"_withCredentials": false,
"_httpClient": {
"proxyAgents": {},
"keepAliveAgents": {},
"cookieJar": {
"version": "[email protected]",
"storeType": "MemoryCookieStore",
"rejectPublicSuffixes": false,
"cookies": []
}
},
"_requestPolicyOptions": {},
"_requestPolicyFactories": [
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{}
],
"authorityHost": "https://login.microsoftonline.com",
"baseUri": "https://login.microsoftonline.com"
}
},
{},
{
"cloudName": "AzureCloud",
"identityClient": {
"_withCredentials": false,
"_httpClient": {
"proxyAgents": {},
"keepAliveAgents": {},
"cookieJar": {
"version": "[email protected]",
"storeType": "MemoryCookieStore",
"rejectPublicSuffixes": false,
"cookies": []
}
},
"_requestPolicyOptions": {},
"_requestPolicyFactories": [
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{}
],
"authorityHost": "https://login.microsoftonline.com",
"baseUri": "https://login.microsoftonline.com"
},
"tenantId": "common"
}
]
}To Reproduce
Steps to reproduce the behavior:
- Login on Azure Account extension
- Install @azure/[email protected]
- Login to your azure account
- new DefaultAzureCredential()
Expected behavior
I expect to receive a credential since I'm logged into the extension.
Screenshots
Just "Proof" that I'm logged into the extension:

Additional context
I'm also logged into the CLI.
I have access to several subscriptions.
I have not configured ANY environment variables (not needed?)
When running VisualStudioCodeCredential() directly I get this back:
{
"cloudName": "AzureCloud",
"identityClient": {
"_withCredentials": false,
"_httpClient": {
"proxyAgents": {},
"keepAliveAgents": {},
"cookieJar": {
"version": "[email protected]",
"storeType": "MemoryCookieStore",
"rejectPublicSuffixes": false,
"cookies": []
}
},
"_requestPolicyOptions": {},
"_requestPolicyFactories": [
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{}
],
"authorityHost": "https://login.microsoftonline.com",
"baseUri": "https://login.microsoftonline.com"
},
"tenantId": "common"
}