# MicrosoftGraphOAuth2PermissionGrant Properties

- Package: [Aspire.Hosting.Azure.EntraId](/reference/api/csharp/aspire.hosting.azure.entraid.md)
- Type: [MicrosoftGraphOAuth2PermissionGrant](/reference/api/csharp/aspire.hosting.azure.entraid/microsoftgraphoauth2permissiongrant.md)
- Kind: `Properties`
- Members: `5`

Models a delegated permission grant ( `oauth2PermissionGrant`) that consents to scopes of an API on behalf of users.

<a id="clientid"></a>

## ClientId

- Name: `ClientId`
- Modifiers: `get; set`
- Returns: `BicepValue<string>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/2d325b13709752ba6d9a943635c5e2940a2530c0/src/Aspire.Hosting.Azure.EntraId/Provisioning/MicrosoftGraphPermissionGrants.cs)

Gets or sets the object ID of the client's service principal.

```csharp
public BicepValue<string> ClientId { get; set; }
```

<a id="consenttype"></a>

## ConsentType

- Name: `ConsentType`
- Modifiers: `get; set`
- Returns: `BicepValue<string>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/2d325b13709752ba6d9a943635c5e2940a2530c0/src/Aspire.Hosting.Azure.EntraId/Provisioning/MicrosoftGraphPermissionGrants.cs)

Gets or sets who consents: `AllPrincipals` grants the scopes tenant-wide.

```csharp
public BicepValue<string> ConsentType { get; set; }
```

<a id="id"></a>

## Id

- Name: `Id`
- Modifiers: `get`
- Returns: `BicepValue<string>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/2d325b13709752ba6d9a943635c5e2940a2530c0/src/Aspire.Hosting.Azure.EntraId/Provisioning/MicrosoftGraphPermissionGrants.cs#L19)

Gets the permission grant's directory object ID.

```csharp
public BicepValue<string> Id { get; }
```

<a id="resourceid"></a>

## ResourceId

- Name: `ResourceId`
- Modifiers: `get; set`
- Returns: `BicepValue<string>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/2d325b13709752ba6d9a943635c5e2940a2530c0/src/Aspire.Hosting.Azure.EntraId/Provisioning/MicrosoftGraphPermissionGrants.cs)

Gets or sets the object ID of the API's service principal.

```csharp
public BicepValue<string> ResourceId { get; set; }
```

<a id="scope"></a>

## Scope

- Name: `Scope`
- Modifiers: `get; set`
- Returns: `BicepValue<string>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/2d325b13709752ba6d9a943635c5e2940a2530c0/src/Aspire.Hosting.Azure.EntraId/Provisioning/MicrosoftGraphPermissionGrants.cs)

Gets or sets the granted scope values, separated by a single space.

```csharp
public BicepValue<string> Scope { get; set; }
```
