# RunWithLocalDeveloperCertificateCredential

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

Creates and provisions a short-lived certificate credential for local development.

## Remarks

Each application gets a dedicated certificate in the AppHost's local store. Certificates last two days;
on a subsequent run, a certificate with one day or less remaining is replaced by overwriting its PFX file.
Only the public certificate is provisioned in Entra. Referencing applications receive the private
credential as a secret `Base64EncodedValue` in Microsoft.Identity.Web's `ClientCredentials` configuration.
Aspire replaces the registration's entire `keyCredentials` collection with the selected certificate.
Existing certificate credentials are not retained, so older sessions must restart after renewal.
Development and production must use separate Entra registrations. Never register developer certificates
on a production application. Different resource groups do not isolate tenant-scoped registrations:
use distinct registration names or tenant-resource suffixes. This method does not provision or emit a credential when publishing;
omitting a credential from publish does not revoke a key previously registered against the same application.
In either mode, this configuration prevents conversion to an existing registration with `AsExistingApplication`.
Renewal is checked at AppHost startup, not in the background. Restart long-running development sessions
before the certificate expires. Use `PublishWithFederatedManagedIdentityCredential` for deployed workloads.

## Definition

```go
func (EntraIdApplicationResource) RunWithLocalDeveloperCertificateCredential() EntraIdApplicationResource
```

## 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)
