VisualStudioCodeCredential Class

Authenticates as the Azure user signed in to Visual Studio Code.

Inheritance
azure.identity._credentials.vscode._VSCodeCredentialBase
VisualStudioCodeCredential
azure.identity._internal.get_token_mixin.GetTokenMixin
VisualStudioCodeCredential

Constructor

VisualStudioCodeCredential(**kwargs: Any)

Parameters

authority
str

authority of an Azure Active Directory 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.

tenant_id
str

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 Azure Active Directory work or school accounts.

Methods

close

Close the credential's transport session.

get_token

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.

close

Close the credential's transport session.

close() -> None

get_token

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.

get_token(*scopes: str, **kwargs: Any) -> AccessToken

Parameters

scopes
str
Required

desired scopes for the access token. This method requires at least one scope.

Return type

Exceptions

the credential cannot retrieve user details from Visual Studio Code