# EntraIdApplicationResource.withAppRole

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

Declares an application role on a registration created by Aspire.

## Definition

```typescript
interface EntraIdApplicationResource {
  // ... omitted for brevity
  withAppRole(
      value: string,
      displayName: string,
      description: string,
      allowedMemberTypes?: string[],
      id?: string,
      isEnabled?: boolean): EntraIdApplicationResource;
}
```

## Signature

```typescript
withAppRole(
    value: string,
    displayName: string,
    description: string,
    allowedMemberTypes?: string[],
    id?: string,
    isEnabled?: boolean): EntraIdApplicationResource
```

## Parameters

- `value` (`string`)
- `displayName` (`string`)
- `description` (`string`)
- `allowedMemberTypes` (`string[]`) `optional`
- `id` (`string`) `optional`
- `isEnabled` (`boolean`) `optional`

## Returns

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

## Defined on

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