# FoundryResource

- Module: [Aspire.Hosting.Foundry](/reference/api/go/aspire.hosting.foundry.md)
- Version: `17.0.0-preview.1.26565.2`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Represents a Microsoft Foundry resource. This corresponds to the Azure Cognitive Services account with Microsoft Foundry capabilities enabled.

## Definition

```go
type FoundryResource interface {
    ExpressionValue
    Resource
    ResourceWithConnectionString
    ResourceWithEndpoints
}
```

## Embeds

- `ExpressionValue`
- `Resource`
- `ResourceWithConnectionString`
- `ResourceWithEndpoints`

## Methods

- [AddDeployment](/reference/api/go/aspire.hosting.foundry/foundryresource/adddeployment.md) -- `method` -- Adds a Microsoft Foundry deployment resource to a Microsoft Foundry resource.
  ```go
  AddDeployment(name string, model any, options ...*AddDeploymentOptions) FoundryDeploymentResource
  ```
- [AddProject](/reference/api/go/aspire.hosting.foundry/foundryresource/addproject.md) -- `method` -- Adds a Microsoft Foundry project resource to the application model. This will also attach the project as a deployment target for agents.
  ```go
  AddProject(name string) AzureCognitiveServicesProjectResource
  ```
- [RunAsFoundryLocal](/reference/api/go/aspire.hosting.foundry/foundryresource/runasfoundrylocal.md) -- `method` -- Configures a Microsoft Foundry resource to use an Aspire-managed or existing Foundry Local service.
  ```go
  RunAsFoundryLocal(options ...*RunAsFoundryLocalOptions) FoundryResource
  ```
