# AddAzureUserAssignedIdentity

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

Adds an Azure user‑assigned identity resource to the application model.

## Remarks

This method adds an Azure user‑assigned identity resource to the application model. It configures the
infrastructure for the resource and returns a builder for the resource.
The resource is added to the infrastructure only if the application is not in run mode.

## Definition

```go
func (DistributedApplicationBuilder) AddAzureUserAssignedIdentity(name string) AzureUserAssignedIdentityResource
```

## Parameters

- `name` (`string`) -- The name of the resource.

## Returns

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

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

## Applies to

- `DistributedApplicationBuilder`
