# WithCertificateFromFile

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

Appends a certificate file credential. The file path is on the consuming resource, not the AppHost.

## Remarks

The password must be marked secret and remains a deferred parameter. File credentials are not recommended for production.

## Definition

```go
func (EntraIdApplicationResource) WithCertificateFromFile(
    filePath string,
    options ...*WithCertificateFromFileOptions,
) EntraIdApplicationResource
```

## Parameters

- `filePath` (`string`) -- The path to the certificate file on the consumer.
- `options` (`...*WithCertificateFromFileOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithCertificateFromFileOptions` argument.

- `Password` (`*ParameterResource`) -- An optional secret parameter for a password-protected certificate.

## Returns

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

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

## Applies to

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