<PackageReference Include="Azure.Core" Version="1.53.0" />

Azure.Identity.ManagedIdentityCredential

Attempts authentication using a managed identity that has been assigned to the deployment environment. This authentication type works for all Azure-hosted environments that support managed identity. For end-to-end guidance, see user-assigned managed identity or system-assigned managed identity.

Protected constructor for mocking.

public ManagedIdentityCredential(string clientId = null, TokenCredentialOptions options = null)

Creates an instance of ManagedIdentityCredential capable of authenticating a resource with a user-assigned or a system-assigned managed identity.

Creates an instance of ManagedIdentityCredential capable of authenticating a resource with a user-assigned managed identity.

Creates an instance of ManagedIdentityCredential capable of authenticating using the specified ManagedIdentityId.

Creates an instance of ManagedIdentityCredential configured with the specified options.