# RoleAssignmentAnnotation

- Kind: `class`
- 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/RoleAssignmentAnnotation.cs)
- Implements: `IResourceAnnotation`

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

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public class RoleAssignmentAnnotation
    : Aspire.Hosting.ApplicationModel.IResourceAnnotation
{
    // ...
}
```

## Remarks

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

## Constructors

- [RoleAssignmentAnnotation(AzureProvisioningResource, IReadOnlySet<RoleDefinition>)](/reference/api/csharp/aspire.hosting.azure/roleassignmentannotation/constructors.md#constructor-azureprovisioningresource-ireadonlyset-roledefinition) -- Specifies the roles that the current resource should be assigned to the target Azure resource.

## Properties

- [Roles](/reference/api/csharp/aspire.hosting.azure/roleassignmentannotation/properties.md#roles) : [IReadOnlySet<RoleDefinition>](/reference/api/csharp/aspire.hosting.azure/roledefinition.md) `get` -- Gets the set of roles the current resource should be assigned to the target Azure resource.
- [Target](/reference/api/csharp/aspire.hosting.azure/roleassignmentannotation/properties.md#target) : [AzureProvisioningResource](/reference/api/csharp/aspire.hosting.azure/azureprovisioningresource.md) `get` -- The Azure resource that the current resource will interact with.
