# EntraIdStoreCertificateCredential

- Kind: `class`
- Package: [Aspire.Hosting.Azure.EntraId](/reference/api/csharp/aspire.hosting.azure.entraid.md)
- Version: `17.0.0-preview.1.26567.5`
- Namespace: `Aspire.Hosting.Azure`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/2d325b13709752ba6d9a943635c5e2940a2530c0/src/Aspire.Hosting.Azure.EntraId/EntraIdApplicationResource.cs)
- Inherits: [EntraIdClientCredential](/reference/api/csharp/aspire.hosting.azure.entraid/entraidclientcredential.md)

A certificate credential from the certificate store for an Entra ID application.

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public sealed class EntraIdStoreCertificateCredential
    : Aspire.Hosting.Azure.EntraIdClientCredential
{
    // ...
}
```

## Remarks

Maps to `SourceType = "StoreWithThumbprint"` or `"StoreWithDistinguishedName"` in Microsoft.Identity.Web configuration, depending on which identifier is provided.

Set exactly one of [EntraIdStoreCertificateCredential.Thumbprint](/reference/api/csharp/aspire.hosting.azure.entraid/entraidstorecertificatecredential/properties.md#thumbprint) or [EntraIdStoreCertificateCredential.DistinguishedName](/reference/api/csharp/aspire.hosting.azure.entraid/entraidstorecertificatecredential/properties.md#distinguishedname). Setting both, or neither, causes [EntraIdStoreCertificateCredential.SourceType](/reference/api/csharp/aspire.hosting.azure.entraid/entraidstorecertificatecredential/properties.md#sourcetype) to throw an `InvalidOperationException`.

## Constructors

- [EntraIdStoreCertificateCredential](/reference/api/csharp/aspire.hosting.azure.entraid/entraidstorecertificatecredential/constructors.md#constructor)

## Properties

- [DistinguishedName](/reference/api/csharp/aspire.hosting.azure.entraid/entraidstorecertificatecredential/properties.md#distinguishedname) : `string?` `get; set` -- Gets or sets the certificate distinguished name (e.g., `"CN=MyCert"`).
- [SourceType](/reference/api/csharp/aspire.hosting.azure.entraid/entraidstorecertificatecredential/properties.md#sourcetype) : `string` `get` -- Gets the `SourceType` string used in the Microsoft.Identity.Web configuration.
- [StorePath](/reference/api/csharp/aspire.hosting.azure.entraid/entraidstorecertificatecredential/properties.md#storepath) : `string` `get; init` -- Gets the certificate store path (e.g., `"CurrentUser/My"` or `"LocalMachine/My"`).
- [Thumbprint](/reference/api/csharp/aspire.hosting.azure.entraid/entraidstorecertificatecredential/properties.md#thumbprint) : `string?` `get; set` -- Gets or sets the certificate thumbprint.
