# AzureRoleAssignmentResource Properties

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

Represents a set of Azure role assignments granted on a target Azure resource.

## IdentityResource

- Name: `IdentityResource`
- Modifiers: `nullable` `get`
- Returns: [AzureUserAssignedIdentityResource?](/reference/api/csharp/aspire.hosting.azure/azureuserassignedidentityresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure/AzureRoleAssignmentResource.cs#L51)

Gets the user-assigned managed identity whose principal receives the role assignments, or `null` for global role assignments that are granted to the deployment principal.

```csharp
public AzureUserAssignedIdentityResource? IdentityResource { get; }
```

## OwnerResource

- Name: `OwnerResource`
- Modifiers: `nullable` `get`
- Returns: `IResource?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure/AzureRoleAssignmentResource.cs#L45)

Gets the Aspire resource that owns this set of role assignments, or `null` for global role assignments that are granted to the deployment principal.

```csharp
public IResource? OwnerResource { get; }
```

## Remarks

This is the resource on which `WithRoleAssignments` was called. Its managed identity is exposed via [AzureRoleAssignmentResource.IdentityResource](/reference/api/csharp/aspire.hosting.azure/azureroleassignmentresource/properties.md#identityresource). When `WithRoleAssignments` is called using an [AzureUserAssignedIdentityResource](/reference/api/csharp/aspire.hosting.azure/azureuserassignedidentityresource.md), OwnerResource and IdentityResource are the same.

## TargetAzureResource

- Name: `TargetAzureResource`
- Modifiers: `get`
- Returns: [AzureProvisioningResource](/reference/api/csharp/aspire.hosting.azure/azureprovisioningresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure/AzureRoleAssignmentResource.cs#L33)

Gets the Azure resource that the roles are assigned on.

```csharp
public AzureProvisioningResource TargetAzureResource { get; }
```
