# IAddRoleAssignmentsContext

- Kind: `interface`
- Package: [Aspire.Hosting.Azure](/reference/api/csharp/aspire.hosting.azure.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.Azure`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure/IAddRoleAssignmentsContext.cs)

Context for adding role assignments to an Azure resource.

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public interface IAddRoleAssignmentsContext
{
    // ...
}
```

## Properties

- [ExecutionContext](/reference/api/csharp/aspire.hosting.azure/iaddroleassignmentscontext/properties.md#executioncontext) : `DistributedApplicationExecutionContext` `abstract` `get` -- Gets the execution context for distributed application.
- [Infrastructure](/reference/api/csharp/aspire.hosting.azure/iaddroleassignmentscontext/properties.md#infrastructure) : [AzureResourceInfrastructure](/reference/api/csharp/aspire.hosting.azure/azureresourceinfrastructure.md) `abstract` `get` -- Gets the Azure resource infrastructure to add the role assignments into.
- [PrincipalId](/reference/api/csharp/aspire.hosting.azure/iaddroleassignmentscontext/properties.md#principalid) : `BicepValue<Guid>` `abstract` `get` -- Gets the principal ID to use in the role assignment.
- [PrincipalName](/reference/api/csharp/aspire.hosting.azure/iaddroleassignmentscontext/properties.md#principalname) : `BicepValue<string>` `abstract` `get` -- Gets the principal name to use in the role assignment.
- [PrincipalType](/reference/api/csharp/aspire.hosting.azure/iaddroleassignmentscontext/properties.md#principaltype) : `BicepValue<RoleManagementPrincipalType>` `abstract` `get` -- Gets the principal type to use in the role assignment.
- [Roles](/reference/api/csharp/aspire.hosting.azure/iaddroleassignmentscontext/properties.md#roles) : [IEnumerable<RoleDefinition>](/reference/api/csharp/aspire.hosting.azure/roledefinition.md) `abstract` `get` -- Gets the roles to be assigned.
