Class AzurePowerShellCredential
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
AzurePowerShellCredentialOptionsOptions 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
TokenRequestContextcancellationToken
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
TokenRequestContextcancellationToken
CancellationToken
Returns
- ValueTask<AccessToken>