/
azure.identity.VisualStudioCodeCredential.yml
101 lines (83 loc) · 3.51 KB
/
azure.identity.VisualStudioCodeCredential.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
### YamlMime:PythonClass
uid: azure.identity.VisualStudioCodeCredential
name: VisualStudioCodeCredential
fullName: azure.identity.VisualStudioCodeCredential
module: azure.identity
inheritances:
- azure.identity._credentials.vscode._VSCodeCredentialBase
- azure.identity._internal.get_token_mixin.GetTokenMixin
summary: 'Authenticates as the Azure user signed in to Visual Studio Code via the
''Azure Account'' extension.
It''s a [known issue](https://github.com/Azure/azure-sdk-for-python/issues/23249)
that this credential doesn''t
work with [Azure Account extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account)
versions newer than **0.9.11**. A long-term fix to this problem is in progress.
In the meantime, consider
authenticating with <xref:azure.identity.AzureCliCredential>.'
constructor:
syntax: 'VisualStudioCodeCredential(**kwargs: Any)'
keywordOnlyParameters:
- name: authority
description: 'Authority of a Microsoft Entra endpoint, for example "login.microsoftonline.com".
This argument is required for a custom cloud and usually unnecessary otherwise.
Defaults to the authority
matching the "Azure: Cloud" setting in VS Code''s user settings or, when that
setting has no value, the
authority for Azure Public Cloud.'
types:
- <xref:str>
- name: tenant_id
description: 'ID of the tenant the credential should authenticate in. Defaults
to the "Azure: Tenant"
setting in VS Code''s user settings or, when that setting has no value, the
"organizations" tenant, which
supports only Microsoft Entra work or school accounts.'
types:
- <xref:str>
- name: additionally_allowed_tenants
description: 'Specifies tenants in addition to the specified "tenant_id"
for which the credential may acquire tokens. Add the wildcard value "*" to allow
the credential to
acquire tokens for any tenant the application can access.'
types:
- <xref:typing.List>[<xref:str>]
methods:
- uid: azure.identity.VisualStudioCodeCredential.close
name: close
summary: Close the credential's transport session.
signature: close() -> None
- uid: azure.identity.VisualStudioCodeCredential.get_token
name: get_token
summary: 'Request an access token for *scopes* as the user currently signed in to
Visual Studio Code.
This method is called automatically by Azure SDK clients.'
signature: 'get_token(*scopes: str, claims: str | None = None, tenant_id: str |
None = None, **kwargs: Any) -> AccessToken'
parameters:
- name: scopes
description: 'desired scopes for the access token. This method requires at least
one scope.
For more information about scopes, see
[https://learn.microsoft.com/entra/identity-platform/scopes-oidc](https://learn.microsoft.com/entra/identity-platform/scopes-oidc).'
isRequired: true
types:
- <xref:str>
keywordOnlyParameters:
- name: claims
description: 'additional claims required in the token, such as those returned
in a resource provider''s
claims challenge following an authorization failure.'
types:
- <xref:str>
- name: tenant_id
description: optional tenant to include in the token request.
types:
- <xref:str>
return:
description: An access token with the desired scopes.
types:
- <xref:azure.core.credentials.AccessToken>
exceptions:
- type: azure.identity.CredentialUnavailableError
description: 'the credential cannot retrieve user details from Visual
Studio Code'