# ITokenCredentialProvider

- Kind: `interface`
- Package: [Aspire.Hosting.Azure](/reference/api/csharp/aspire.hosting.azure.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.Azure`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure/ITokenCredentialProvider.cs)

Provides access to the [ITokenCredentialProvider.TokenCredential](/reference/api/csharp/aspire.hosting.azure/itokencredentialprovider/properties.md#tokencredential) that Aspire uses to authenticate against Azure when provisioning resources and calling Azure APIs.

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public interface ITokenCredentialProvider
{
    // ...
}
```

## Remarks

This service is registered as a singleton when Azure provisioning is enabled (e.g., by `AddAzureProvisioning`).

Integrations and app host code can resolve this service from `IServiceProvider` to obtain a [ITokenCredentialProvider.TokenCredential](/reference/api/csharp/aspire.hosting.azure/itokencredentialprovider/properties.md#tokencredential) instance configured by Aspire's Azure provisioning options (for example, the configured tenant id and credential source). The concrete credential type returned by [ITokenCredentialProvider.TokenCredential](/reference/api/csharp/aspire.hosting.azure/itokencredentialprovider/properties.md#tokencredential) is an implementation detail and may change between releases; callers should treat the value as an opaque [ITokenCredentialProvider.TokenCredential](/reference/api/csharp/aspire.hosting.azure/itokencredentialprovider/properties.md#tokencredential).

## Properties

- [TokenCredential](/reference/api/csharp/aspire.hosting.azure/itokencredentialprovider/properties.md#tokencredential) : `TokenCredential` `abstract` `get` -- Gets the [ITokenCredentialProvider.TokenCredential](/reference/api/csharp/aspire.hosting.azure/itokencredentialprovider/properties.md#tokencredential) to use for Azure authentication.
