# FoundryResource Methods

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

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

## AddAsExistingResource(AzureResourceInfrastructure)

- Name: `AddAsExistingResource(AzureResourceInfrastructure)`
- Modifiers: `virtual`
- Returns: `CognitiveServicesAccount`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/FoundryResource.cs#L93-L116)

```csharp
public class FoundryResource
{
    public virtual CognitiveServicesAccount AddAsExistingResource(
        AzureResourceInfrastructure infra)
    {
        // ...
    }
}
```

## Parameters

- `infra` (`AzureResourceInfrastructure`)
