# 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/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Foundry/HostedAgent/AzureHostedAgentResource.cs#L23-L79)

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`
