# ClearDefaultRoleAssignments

- Module: [Aspire.Hosting.Azure](/reference/api/go/aspire.hosting.azure.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: [`AzureResource`](/reference/api/go/aspire.hosting.azure/azureresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Clears all default role assignments for the specified Azure resource.

## Remarks

This method removes all default role assignments from the Azure resource. This can be useful when
role assignments can't be created, for example on existing resources where you don't have permission
to create the assignments.

## Definition

```go
func (AzureResource) ClearDefaultRoleAssignments() AzureResource
```

## Returns

[`AzureResource`](/reference/api/go/aspire.hosting.azure/azureresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`AzureBicepResource`](/reference/api/go/aspire.hosting.azure/azurebicepresource.md)
- [`AzureProvisioningResource`](/reference/api/go/aspire.hosting.azure/azureprovisioningresource.md)
- [`AzureUserAssignedIdentityResource`](/reference/api/go/aspire.hosting.azure/azureuserassignedidentityresource.md)
