# WithCertificateDistinguishedName

- Module: [Aspire.Hosting.Azure.EntraId](/reference/api/go/aspire.hosting.azure.entraid.md)
- Version: `17.0.0-preview.1.26565.2`
- Kind: `method`
- Defined on: [`EntraIdApplicationResource`](/reference/api/go/aspire.hosting.azure.entraid/entraidapplicationresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Adds a certificate credential from the certificate store by distinguished name.

## Definition

```go
func (EntraIdApplicationResource) WithCertificateDistinguishedName(
    storePath string,
    distinguishedName string,
) EntraIdApplicationResource
```

## Parameters

- `storePath` (`string`) -- The certificate store path (e.g., `"CurrentUser/My"`).
- `distinguishedName` (`string`) -- The certificate distinguished name (e.g., `"CN=MyCert"`).

## Returns

[`EntraIdApplicationResource`](/reference/api/go/aspire.hosting.azure.entraid/entraidapplicationresource.md) -- The resource builder for chaining.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`EntraIdApplicationResource`](/reference/api/go/aspire.hosting.azure.entraid/entraidapplicationresource.md)
