# AzureHostedAgentResource Constructors

- Package: [Aspire.Hosting.Foundry](/reference/api/csharp/aspire.hosting.foundry.md)
- Type: [AzureHostedAgentResource](/reference/api/csharp/aspire.hosting.foundry/azurehostedagentresource.md)
- Kind: `Constructors`
- Members: `1`

A Microsoft Foundry hosted agent resource.

## AzureHostedAgentResource(string, IResource, Action<HostedAgentConfiguration>)

- Name: `Constructor(string, IResource, Action<HostedAgentConfiguration>)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/HostedAgent/AzureHostedAgentResource.cs#L36-L92)

Creates a new instance of the [AzureHostedAgentResource](/reference/api/csharp/aspire.hosting.foundry/azurehostedagentresource.md) class.

```csharp
public class AzureHostedAgentResource
{
    public AzureHostedAgentResource(
        string name,
        IResource target,
        Action<HostedAgentConfiguration>? configure = null)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
- `target` (`IResource`)
- `configure` (`Action<HostedAgentConfiguration>`) `optional`
