# FoundryResource Properties

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

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

## AIFoundryApiEndpoint

- Name: `AIFoundryApiEndpoint`
- Modifiers: `get`
- Returns: `BicepOutputReference`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/FoundryResource.cs#L29)

Gets the "aiFoundryApiEndpoint" output reference from the Microsoft Foundry resource.

```csharp
public BicepOutputReference AIFoundryApiEndpoint { get; }
```

## ApiKey

- Name: `ApiKey`
- Modifiers: `nullable` `get`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/FoundryResource.cs)

The API key to access Foundry Local.

```csharp
public string? ApiKey { get; }
```

## CapabilityHost

- Name: `CapabilityHost`
- Modifiers: `nullable` `get; set`
- Returns: `CognitiveServicesCapabilityHost?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/FoundryResource.cs)

The capability host associated with this project, if any. If none is set, we provision a default capability host for hosted agents.

```csharp
public CognitiveServicesCapabilityHost? CapabilityHost { get; set; }
```

## ConnectionStringExpression

- Name: `ConnectionStringExpression`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/FoundryResource.cs#L64-L66)

Gets the connection string template for the manifest for the resource.

```csharp
public ReferenceExpression ConnectionStringExpression { get; }
```

## Deployments

- Name: `Deployments`
- Modifiers: `get`
- Returns: [IReadOnlyList<FoundryDeploymentResource>](/reference/api/csharp/aspire.hosting.foundry/foundrydeploymentresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/FoundryResource.cs#L71)

Gets the list of deployment resources associated with the Microsoft Foundry.

```csharp
public IReadOnlyList<FoundryDeploymentResource> Deployments { get; }
```

## Endpoint

- Name: `Endpoint`
- Modifiers: `get`
- Returns: `BicepOutputReference`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/FoundryResource.cs#L34)

Gets the "endpoint" output reference from the Microsoft Foundry resource.

```csharp
public BicepOutputReference Endpoint { get; }
```

## Id

- Name: `Id`
- Modifiers: `get`
- Returns: `BicepOutputReference`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/FoundryResource.cs#L44)

Gets the "id" output reference for the resource.

```csharp
public BicepOutputReference Id { get; }
```

## IsEmulator

- Name: `IsEmulator`
- Modifiers: `get`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/FoundryResource.cs#L83)

Gets whether the resource is running in Foundry Local.

```csharp
public bool IsEmulator { get; }
```

## NameOutputReference

- Name: `NameOutputReference`
- Modifiers: `get`
- Returns: `BicepOutputReference`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/FoundryResource.cs#L39)

Gets the "name" output reference for the resource.

```csharp
public BicepOutputReference NameOutputReference { get; }
```

## UriExpression

- Name: `UriExpression`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/FoundryResource.cs#L54-L58)

Gets the connection URI expression for the Microsoft Foundry endpoint.

```csharp
public ReferenceExpression UriExpression { get; }
```

## Remarks

In emulator mode, resolves to the emulator service URI. In Azure mode, resolves to the Microsoft Foundry endpoint.
