# AzureUserAssignedIdentityResource Methods

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

An Azure Provisioning resource that represents an Azure user assigned managed identity.

## AddAsExistingResource(AzureResourceInfrastructure)

- Name: `AddAsExistingResource(AzureResourceInfrastructure)`
- Modifiers: `override`
- Returns: `ProvisionableResource`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure/AzureUserAssignedIdentityResource.cs#L69-L92)

Adds a new `Primitives.ProvisionableResource` into `infra`. The new resource represents a reference to the current [AzureProvisioningResource](/reference/api/csharp/aspire.hosting.azure/azureprovisioningresource.md) via https://learn.microsoft.com/azure/azure-resource-manager/bicep/existing-resource.

```csharp
public sealed class AzureUserAssignedIdentityResource
{
    public override ProvisionableResource AddAsExistingResource(
        AzureResourceInfrastructure infra)
    {
        // ...
    }
}
```

## Parameters

- `infra` ([AzureResourceInfrastructure](/reference/api/csharp/aspire.hosting.azure/azureresourceinfrastructure.md))
  The [AzureResourceInfrastructure](/reference/api/csharp/aspire.hosting.azure/azureresourceinfrastructure.md) to add the existing resource into.

## Returns

`ProvisionableResource` -- A new `Primitives.ProvisionableResource`, typically using the FromExisting method on the derived `Primitives.ProvisionableResource` class.
