# AzureHostedAgentResource

- Kind: `class`
- Package: [Aspire.Hosting.Foundry](/reference/api/csharp/aspire.hosting.foundry.md)
- Version: `13.3.0-preview.1.26254.5`
- Namespace: `Aspire.Hosting.Foundry`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Foundry/HostedAgent/AzureHostedAgentResource.cs)
- Inherits: `Resource`
- Implements: `IResource`, `IResourceWithEnvironment`

A Microsoft Foundry hosted agent resource.

## Definition

```csharp
namespace Aspire.Hosting.Foundry;

public class AzureHostedAgentResource
    : Aspire.Hosting.ApplicationModel.Resource,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithEnvironment
{
    // ...
}
```

## Constructors

- [AzureHostedAgentResource(string, IResource, Action<HostedAgentConfiguration>)](/reference/api/csharp/aspire.hosting.foundry/azurehostedagentresource/constructors.md#constructor-string-iresource-action-hostedagentconfiguration) -- Creates a new instance of the [AzureHostedAgentResource](/reference/api/csharp/aspire.hosting.foundry/azurehostedagentresource.md) class.

## Properties

- [Configure](/reference/api/csharp/aspire.hosting.foundry/azurehostedagentresource/properties.md#configure) : `Action<HostedAgentConfiguration>` `get; set` -- Configuration action to customize the hosted agent definition during deployment.
- [Image](/reference/api/csharp/aspire.hosting.foundry/azurehostedagentresource/properties.md#image) : `ContainerImageReference` `get` -- The fully qualified image name for the hosted agent.
- [Target](/reference/api/csharp/aspire.hosting.foundry/azurehostedagentresource/properties.md#target) : `IResource` `get` -- The target containerized workload that this hosted agent deploys.
- [Version](/reference/api/csharp/aspire.hosting.foundry/azurehostedagentresource/properties.md#version) : `StaticValueProvider<string>` `get` -- Once deployed, the version that is assigned to this hosted agent.

## Methods

- [DeployAsync(PipelineStepContext, AzureCognitiveServicesProjectResource)](/reference/api/csharp/aspire.hosting.foundry/azurehostedagentresource/methods.md#deployasync-pipelinestepcontext-azurecognitiveservicesprojectresource) : `Task<ProjectsAgentVersion>` -- Deploys the specified agent to the given Microsoft Foundry project.
- [PublishAsync(ManifestPublishingContext)](/reference/api/csharp/aspire.hosting.foundry/azurehostedagentresource/methods.md#publishasync-manifestpublishingcontext) : `Task` -- Publishes the hosted agent during the manifest publishing phase.
- [ToHostedAgentConfigurationAsync(PipelineStepContext)](/reference/api/csharp/aspire.hosting.foundry/azurehostedagentresource/methods.md#tohostedagentconfigurationasync-pipelinestepcontext) : [Task<HostedAgentConfiguration>](/reference/api/csharp/aspire.hosting.foundry/hostedagentconfiguration.md) -- Convert all dynamic values into concrete values for deployment.
