# AzureCognitiveServicesProjectResource

- Kind: `class`
- Package: [Aspire.Hosting.Foundry](/reference/api/csharp/aspire.hosting.foundry.md)
- Version: `13.4.0-preview.1.26281.18`
- Namespace: `Aspire.Hosting.Foundry`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/Project/ProjectResource.cs)
- Inherits: `AzureProvisionableAspireResourceWithParent<CognitiveServicesProject, FoundryResource>`
- Implements: `IComputeEnvironmentResource`, `IExpressionValue`, `IManifestExpressionProvider`, `IResource`, `IResourceWithConnectionString`, `IValueProvider`, `IValueWithReferences`, `IAzureComputeEnvironmentResource`

The Microsoft Foundry project resource that can be used for Microsoft Foundry AI agents. This also functions as an Aspire compute environment resource for deployment.

## Definition

```csharp
namespace Aspire.Hosting.Foundry;

public class AzureCognitiveServicesProjectResource
    : Aspire.Hosting.Foundry.AzureProvisionableAspireResourceWithParent<Azure.Provisioning.CognitiveServices.CognitiveServicesProject, Aspire.Hosting.Foundry.FoundryResource>,
      Aspire.Hosting.ApplicationModel.IComputeEnvironmentResource,
      Aspire.Hosting.ApplicationModel.IExpressionValue,
      Aspire.Hosting.ApplicationModel.IManifestExpressionProvider,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithConnectionString,
      Aspire.Hosting.ApplicationModel.IValueProvider,
      Aspire.Hosting.ApplicationModel.IValueWithReferences,
      Aspire.Hosting.Azure.IAzureComputeEnvironmentResource
{
    // ...
}
```

## Constructors

- [AzureCognitiveServicesProjectResource(string, Action<AzureResourceInfrastructure>, FoundryResource)](/reference/api/csharp/aspire.hosting.foundry/azurecognitiveservicesprojectresource/constructors.md#constructor-string-action-azureresourceinfrastructure-foundryresource) -- Creates a new Microsoft Foundry project resource.

## Properties

- [AppInsights](/reference/api/csharp/aspire.hosting.foundry/azurecognitiveservicesprojectresource/properties.md#appinsights) : `AzureApplicationInsightsResource?` `get; set` -- The Application Insights resource associated with this project, if any. This will be used as the destination for server-side telemetry from hosted agents and optionally for client-side telemetry if the application decides to use it.
- [CapabilityHostConfiguration](/reference/api/csharp/aspire.hosting.foundry/azurecognitiveservicesprojectresource/properties.md#capabilityhostconfiguration) : [CapabilityHostConfiguration?](/reference/api/csharp/aspire.hosting.foundry/capabilityhostconfiguration.md) `get; set` -- The capability host resources associated with this project, if any
- [ConnectionStringExpression](/reference/api/csharp/aspire.hosting.foundry/azurecognitiveservicesprojectresource/properties.md#connectionstringexpression) : `ReferenceExpression` `get` -- Gets the .NET-style connection string for the project API endpoint.
- [ContainerRegistry](/reference/api/csharp/aspire.hosting.foundry/azurecognitiveservicesprojectresource/properties.md#containerregistry) : `AzureContainerRegistryResource?` `get` -- Gets the Azure Container Registry resource used by this project.
- [Endpoint](/reference/api/csharp/aspire.hosting.foundry/azurecognitiveservicesprojectresource/properties.md#endpoint) : `BicepOutputReference` `get` -- Gets the "endpoint" output reference from the Microsoft Foundry project resource. This will be used to instantiate the AI project clients. Will be of the format https:/{accountName}.services.ai.azure.com/api/projects/{projectName}?api-version={apiVersion}
- [Id](/reference/api/csharp/aspire.hosting.foundry/azurecognitiveservicesprojectresource/properties.md#id) : `BicepOutputReference` `get` -- Azure Resource ID output reference.
- [KeyVaultConn](/reference/api/csharp/aspire.hosting.foundry/azurecognitiveservicesprojectresource/properties.md#keyvaultconn) : [AzureCognitiveServicesProjectConnectionResource?](/reference/api/csharp/aspire.hosting.foundry/azurecognitiveservicesprojectconnectionresource.md) `get; set` -- Connection to the user-assigned key vault, if any.
- [PrincipalId](/reference/api/csharp/aspire.hosting.foundry/azurecognitiveservicesprojectresource/properties.md#principalid) : `BicepOutputReference` `get` -- Gets the managed identity principal ID, whether system-assigned or user-assigned.
- [UriExpression](/reference/api/csharp/aspire.hosting.foundry/azurecognitiveservicesprojectresource/properties.md#uriexpression) : `ReferenceExpression` `get` -- Gets the Microsoft Foundry project endpoint as a ReferenceExpression that can be used in environment variables or connection strings. This will be used to instantiate the AI project clients. Will be of the format https:/{accountName}.services.ai.azure.com/api/projects/{projectName}?api-version={apiVersion}

## Methods

- [FromExisting(string)](/reference/api/csharp/aspire.hosting.foundry/azurecognitiveservicesprojectresource/methods.md#fromexisting-string) : `CognitiveServicesProject` -- Gets the Azure.Provisioning resource from an existing Bicep identifier. Because static methods can't be abstract, this is an instance method.
- [SetName(CognitiveServicesProject, BicepValue<string>)](/reference/api/csharp/aspire.hosting.foundry/azurecognitiveservicesprojectresource/methods.md#setname-cognitiveservicesproject-bicepvalue-string) -- Sets the name of the provisionable resource. This is needed because not all ProvisionableResource classes have a name property with a setter, and we can't put a type bound on T to require it.
- [TryGetAppIdentityResource(IAppIdentityResource?)](/reference/api/csharp/aspire.hosting.foundry/azurecognitiveservicesprojectresource/methods.md#trygetappidentityresource-iappidentityresource) : `bool` -- Tries to get the application identity resource associated with this project via the `Azure.AppIdentityAnnotation`. This is the identity that will be used by the project to access other Azure resources such as the container registry.
