# IAddRoleAssignmentsContext Properties

- Package: [Aspire.Hosting.Azure](/reference/api/csharp/aspire.hosting.azure.md)
- Type: [IAddRoleAssignmentsContext](/reference/api/csharp/aspire.hosting.azure/iaddroleassignmentscontext.md)
- Kind: `Properties`
- Members: `6`

Context for adding role assignments to an Azure resource.

## ExecutionContext

- Name: `ExecutionContext`
- Modifiers: `abstract` `get`
- Returns: `DistributedApplicationExecutionContext`

Gets the execution context for distributed application.

```csharp
public abstract DistributedApplicationExecutionContext ExecutionContext { get; }
```

## Infrastructure

- Name: `Infrastructure`
- Modifiers: `abstract` `get`
- Returns: [AzureResourceInfrastructure](/reference/api/csharp/aspire.hosting.azure/azureresourceinfrastructure.md)

Gets the Azure resource infrastructure to add the role assignments into.

```csharp
public abstract AzureResourceInfrastructure Infrastructure { get; }
```

## PrincipalId

- Name: `PrincipalId`
- Modifiers: `abstract` `get`
- Returns: `BicepValue<Guid>`

Gets the principal ID to use in the role assignment.

```csharp
public abstract BicepValue<Guid> PrincipalId { get; }
```

## PrincipalName

- Name: `PrincipalName`
- Modifiers: `abstract` `get`
- Returns: `BicepValue<string>`

Gets the principal name to use in the role assignment.

```csharp
public abstract BicepValue<string> PrincipalName { get; }
```

## Remarks

Not all role assignments require/use a principal name.

## PrincipalType

- Name: `PrincipalType`
- Modifiers: `abstract` `get`
- Returns: `BicepValue<RoleManagementPrincipalType>`

Gets the principal type to use in the role assignment.

```csharp
public abstract BicepValue<RoleManagementPrincipalType> PrincipalType { get; }
```

## Roles

- Name: `Roles`
- Modifiers: `abstract` `get`
- Returns: [IEnumerable<RoleDefinition>](/reference/api/csharp/aspire.hosting.azure/roledefinition.md)

Gets the roles to be assigned.

```csharp
public abstract IEnumerable<RoleDefinition> Roles { get; }
```
