# WithClientSecret

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

Adds a client secret credential to this Entra ID application.

## Remarks

This adds an entry to the `ClientCredentials` array in the Microsoft.Identity.Web
configuration with `SourceType` set to `"ClientSecret"`.

## Definition

```go
func (EntraIdApplicationResource) WithClientSecret(clientSecret ParameterResource) EntraIdApplicationResource
```

## Parameters

- `clientSecret` (`ParameterResource`) -- A secret parameter containing the client secret.

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