# EntraIdScope

- Kind: `class`
- Package: [Aspire.Hosting.Azure.EntraId](/reference/api/csharp/aspire.hosting.azure.entraid.md)
- Version: `17.0.0-preview.1.26567.5`
- Namespace: `Aspire.Hosting.Azure`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/2d325b13709752ba6d9a943635c5e2940a2530c0/src/Aspire.Hosting.Azure.EntraId/EntraIdApi.cs)

Describes a delegated permission scope that an API registration created by Aspire exposes.

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public sealed class EntraIdScope
{
    // ...
}
```

## Remarks

The scope's ID is stable across deployments: unless [EntraIdScope.Id](/reference/api/csharp/aspire.hosting.azure.entraid/entraidscope/properties.md#id) is set, it derives from the registration's name and the scope's [EntraIdScope.Name](/reference/api/csharp/aspire.hosting.azure.entraid/entraidscope/properties.md#name). Microsoft Graph does not allow a scope to be removed, or its name to change, while it is enabled. To retire a scope, set [EntraIdScope.IsEnabled](/reference/api/csharp/aspire.hosting.azure.entraid/entraidscope/properties.md#isenabled) to `false`, deploy, and then remove the scope in a later deployment.

## Properties

- [Description](/reference/api/csharp/aspire.hosting.azure.entraid/entraidscope/properties.md#description) : `string` `get; set` -- Gets or sets what the scope allows, shown on the admin consent page.
- [DisplayName](/reference/api/csharp/aspire.hosting.azure.entraid/entraidscope/properties.md#displayname) : `string` `get; set` -- Gets or sets the scope's title, shown on the admin consent page. Defaults to [EntraIdScope.Name](/reference/api/csharp/aspire.hosting.azure.entraid/entraidscope/properties.md#name).
- [Id](/reference/api/csharp/aspire.hosting.azure.entraid/entraidscope/properties.md#id) : `Guid?` `get; set` -- Gets or sets the scope's ID, which must stay the same across deployments.
- [IsEnabled](/reference/api/csharp/aspire.hosting.azure.entraid/entraidscope/properties.md#isenabled) : `bool` `get; set` -- Gets or sets whether clients can request the scope. Defaults to `true`.
- [Name](/reference/api/csharp/aspire.hosting.azure.entraid/entraidscope/properties.md#name) : `string` `get` -- Gets the scope's name, the value that appears in the token's `scp` claim, such as `access_as_user`.
- [RequiresAdminConsent](/reference/api/csharp/aspire.hosting.azure.entraid/entraidscope/properties.md#requiresadminconsent) : `bool` `get; set` -- Gets or sets whether only an administrator can consent to the scope. Defaults to `false`, which lets users consent.
- [UserConsentDescription](/reference/api/csharp/aspire.hosting.azure.entraid/entraidscope/properties.md#userconsentdescription) : `string?` `get; set` -- Gets or sets what the scope allows, shown on the consent page for users. When `null`, [EntraIdScope.Description](/reference/api/csharp/aspire.hosting.azure.entraid/entraidscope/properties.md#description) is used.
- [UserConsentDisplayName](/reference/api/csharp/aspire.hosting.azure.entraid/entraidscope/properties.md#userconsentdisplayname) : `string?` `get; set` -- Gets or sets the scope's title shown on the consent page for users. When `null`, [EntraIdScope.DisplayName](/reference/api/csharp/aspire.hosting.azure.entraid/entraidscope/properties.md#displayname) is used.
