Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ManagedIdentityCredential

Package version

Attempts authentication using a managed identity available at the deployment environment. This authentication type works in Azure VMs, App Service instances, Azure Functions applications, Azure Kubernetes Services, Azure Service Fabric instances and inside of the Azure Cloud Shell.

More information about configuring managed identities can be found here: https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview

Hierarchy

  • ManagedIdentityCredential

Implements

  • any
  • any

Index

Methods

Methods

getToken

  • getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken>
  • Authenticates with Azure Active Directory and returns an access token if successful. If authentication fails, a CredentialUnavailableError will be thrown with the details of the failure. If an unexpected error occurs, an AuthenticationError will be thrown with the details of the failure.

    Parameters

    • scopes: string | string[]

      The list of scopes for which the token will have access.

    • Optional options: GetTokenOptions

      The options used to configure any requests this TokenCredential implementation might make.

    Returns Promise<AccessToken>

Generated using TypeDoc