# EntraIdApplicationResource.WithClientSecret

- Module: [Aspire.Hosting.Azure.EntraId](/reference/api/go/aspire.hosting.azure.entraid.md)
- Defined on: [EntraIdApplicationResource](/reference/api/go/aspire.hosting.azure.entraid/entraidapplicationresource.md)
- Version: `17.0.0-preview.1.26567.5`
- Kind: `method`

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
type EntraIdApplicationResource interface {
    // ... omitted for brevity
    WithClientSecret(clientSecret ParameterResource) EntraIdApplicationResource
}
```

## Signature

```go
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()`.

## Defined on

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