Package version:
Creates an instance of the AzurePowerShellCredential.
To use this credential:
Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force
.Connect-AzAccount
from the command line.Optional
options: AzurePowerShellCredentialOptionsOptions, to optionally allow multi-tenant requests.
Authenticates with Microsoft Entra ID and returns an access token if successful. If the authentication cannot be performed through PowerShell, a CredentialUnavailableError will be thrown.
The list of scopes for which the token will have access.
The options used to configure any requests this TokenCredential implementation might make.
This credential will use the currently logged-in user information from the Azure PowerShell module. To do so, it will read the user access token and expire time with Azure PowerShell command
Get-AzAccessToken -ResourceUrl {ResourceScope}