Table of Contents

Class AzurePowerShellCredential

Namespace
Azure.Identity
Assembly
Azure.Identity.dll

Enables authentication to Microsoft Entra ID using Azure PowerShell to obtain an access token.

public class AzurePowerShellCredential : TokenCredential
Inheritance
AzurePowerShellCredential

Constructors

AzurePowerShellCredential()

Creates a new instance of the AzurePowerShellCredential.

public AzurePowerShellCredential()

AzurePowerShellCredential(AzurePowerShellCredentialOptions)

Creates a new instance of the AzurePowerShellCredential with the specified options.

public AzurePowerShellCredential(AzurePowerShellCredentialOptions options)

Parameters

options AzurePowerShellCredentialOptions

Options for configuring the credential.

Methods

GetToken(TokenRequestContext, CancellationToken)

Obtains a access token from Azure PowerShell, using the access token to authenticate. This method id called by Azure SDK clients.

public override AccessToken GetToken(TokenRequestContext requestContext, CancellationToken cancellationToken)

Parameters

requestContext TokenRequestContext
cancellationToken CancellationToken

Returns

AccessToken

GetTokenAsync(TokenRequestContext, CancellationToken)

Obtains a access token from Azure PowerShell, using the access token to authenticate. This method id called by Azure SDK clients.

public override ValueTask<AccessToken> GetTokenAsync(TokenRequestContext requestContext, CancellationToken cancellationToken = default)

Parameters

requestContext TokenRequestContext
cancellationToken CancellationToken

Returns

ValueTask<AccessToken>