# RoleAssignmentAnnotation Constructors

- Package: [Aspire.Hosting.Azure](/reference/api/csharp/aspire.hosting.azure.md)
- Type: [RoleAssignmentAnnotation](/reference/api/csharp/aspire.hosting.azure/roleassignmentannotation.md)
- Kind: `Constructors`
- Members: `1`

Specifies the roles that the current resource should be assigned to the target Azure resource.

## RoleAssignmentAnnotation(AzureProvisioningResource, IReadOnlySet<RoleDefinition>)

- Name: `Constructor(AzureProvisioningResource, IReadOnlySet<RoleDefinition>)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure/RoleAssignmentAnnotation.cs#L16-L26)

Specifies the roles that the current resource should be assigned to the target Azure resource.

```csharp
public class RoleAssignmentAnnotation
{
    public RoleAssignmentAnnotation(
        AzureProvisioningResource target,
        IReadOnlySet<RoleDefinition> roles)
    {
        // ...
    }
}
```

## Parameters

- `target` ([AzureProvisioningResource](/reference/api/csharp/aspire.hosting.azure/azureprovisioningresource.md))
  The Azure resource that the current resource will interact with.
- `roles` ([IReadOnlySet<RoleDefinition>](/reference/api/csharp/aspire.hosting.azure/roledefinition.md))
  The roles that the current resource should be assigned to `target`.

## Remarks

This annotation is applied to compute resources (e.g., Projects or Containers) that need to interact with Azure resources.
