# FoundryResource

- Module: [Aspire.Hosting.Foundry](/reference/api/typescript/aspire.hosting.foundry.md)
- Version: `13.4.0-preview.1.26281.18`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire)

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

## Definition

```typescript
interface FoundryResource
  extends IAzureResource,
    IExpressionValue,
    IManifestExpressionProvider,
    IResource,
    IResourceWithConnectionString,
    IResourceWithEndpoints,
    IResourceWithParameters,
    IValueProvider,
    IValueWithReferences,
    IAzureNspAssociationTarget,
    IAzurePrivateEndpointTarget {
  addDeployment(
      name: string,
      model: FoundryModel|string,
      modelVersion?: string,
      format?: string): FoundryDeploymentResource;
  addProject(name: string): AzureCognitiveServicesProjectResource;
  runAsFoundryLocal(): FoundryResource;
}
```

## Methods

- [addDeployment](/reference/api/typescript/aspire.hosting.foundry/foundryresource/adddeployment.md) -- `method` -- Adds a Microsoft Foundry deployment resource to a Microsoft Foundry resource.
    ```typescript
  addDeployment(name: string, model: FoundryModel|string, modelVersion?: string, format?: string): FoundryDeploymentResource
  ```
- [addProject](/reference/api/typescript/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.
    ```typescript
  addProject(name: string): AzureCognitiveServicesProjectResource
  ```
- [runAsFoundryLocal](/reference/api/typescript/aspire.hosting.foundry/foundryresource/runasfoundrylocal.md) -- `method` -- Adds a Foundry Local resource to the distributed application builder.
    ```typescript
  runAsFoundryLocal(): FoundryResource
  ```
