Skip to content
Docs Try Aspire

AzureCognitiveServicesProjectExtensions Methods

Class Methods 9 members
Extension methods for adding Microsoft Foundry project resources to the distributed application model.
AddCapabilityHost(IResourceBuilder<AzureCognitiveServicesProjectResource>, string) Section titled AddCapabilityHost(IResourceBuilder<AzureCognitiveServicesProjectResource>, string) extension CapabilityHostBuilder
Adds a capability host to the Microsoft Foundry project, enabling agent capabilities with external Azure resources such as CosmosDB, Storage, and Search.
public static class AzureCognitiveServicesProjectExtensions
{
public static CapabilityHostBuilder AddCapabilityHost(
this IResourceBuilder<AzureCognitiveServicesProjectResource> builder,
string name)
{
// ...
}
}
builder IResourceBuilder<AzureCognitiveServicesProjectResource> The resource builder for the Microsoft Foundry project.
name string The name of the capability host.
CapabilityHostBuilder A CapabilityHostBuilder for fluent configuration of the capability host resources.
This method is not available in polyglot app hosts.
project.AddCapabilityHost("cap-host")
.WithCosmosDB(cosmosDb)
.WithStorage(storage)
.WithSearch(search)
.WithAzureOpenAI(foundry);
AddModelDeployment(IResourceBuilder<AzureCognitiveServicesProjectResource>, string, FoundryModel) Section titled AddModelDeployment(IResourceBuilder<AzureCognitiveServicesProjectResource>, string, FoundryModel) extension IResourceBuilder<FoundryDeploymentResource>
Adds a model deployment to the parent Microsoft Foundry resource of the Microsoft Foundry project.
public static class AzureCognitiveServicesProjectExtensions
{
public static IResourceBuilder<FoundryDeploymentResource> AddModelDeployment(
this IResourceBuilder<AzureCognitiveServicesProjectResource> builder,
string name,
FoundryModel model)
{
// ...
}
}
builder IResourceBuilder<AzureCognitiveServicesProjectResource> Aspire resource builder for a project
name string Name to give the model deployment
model FoundryModel The FoundryModel to deploy.
IResourceBuilder<FoundryDeploymentResource> A reference to the ApplicationModel.IResourceBuilder`1 for the deployment resource.
AddModelDeployment(IResourceBuilder<AzureCognitiveServicesProjectResource>, string, string, string, string) Section titled AddModelDeployment(IResourceBuilder<AzureCognitiveServicesProjectResource>, string, string, string, string) extension IResourceBuilder<FoundryDeploymentResource>
Adds a model deployment to the parent Microsoft Foundry resource of the Microsoft Foundry project.
public static class AzureCognitiveServicesProjectExtensions
{
public static IResourceBuilder<FoundryDeploymentResource> AddModelDeployment(
this IResourceBuilder<AzureCognitiveServicesProjectResource> builder,
string name,
string modelName,
string modelVersion,
string format)
{
// ...
}
}
builder IResourceBuilder<AzureCognitiveServicesProjectResource>
name string
modelName string
modelVersion string
format string
AddProject(IResourceBuilder<FoundryResource>, string) Section titled AddProject(IResourceBuilder<FoundryResource>, string) extension IResourceBuilder<AzureCognitiveServicesProjectResource>
Adds a Microsoft Foundry project resource to the application model. This will also attach the project as a deployment target for agents.
public static class AzureCognitiveServicesProjectExtensions
{
public static IResourceBuilder<AzureCognitiveServicesProjectResource> AddProject(
this IResourceBuilder<FoundryResource> builder,
string name)
{
// ...
}
}
builder IResourceBuilder<FoundryResource> The ApplicationModel.IResourceBuilder`1 for the parent Microsoft Foundry account resource.
name string The name of the Microsoft Foundry project resource.
IResourceBuilder<AzureCognitiveServicesProjectResource> A reference to the ApplicationModel.IResourceBuilder`1 for the Microsoft Foundry project resource.
WithAppInsights(IResourceBuilder<AzureCognitiveServicesProjectResource>, IResourceBuilder<AzureApplicationInsightsResource>) Section titled WithAppInsights(IResourceBuilder<AzureCognitiveServicesProjectResource>, IResourceBuilder<AzureApplicationInsightsResource>) extension IResourceBuilder<AzureCognitiveServicesProjectResource>
Adds an Application Insights resource to the Microsoft Foundry project, overriding the default (which is to create a new Application Insights resource).
public static class AzureCognitiveServicesProjectExtensions
{
public static IResourceBuilder<AzureCognitiveServicesProjectResource> WithAppInsights(
this IResourceBuilder<AzureCognitiveServicesProjectResource> builder,
IResourceBuilder<AzureApplicationInsightsResource> appInsights)
{
// ...
}
}
builder IResourceBuilder<AzureCognitiveServicesProjectResource> The resource builder for the Microsoft Foundry project.
appInsights IResourceBuilder<AzureApplicationInsightsResource> The Application Insights resource to associate with the project.
IResourceBuilder<AzureCognitiveServicesProjectResource> A reference to the ApplicationModel.IResourceBuilder`1 for chaining.
WithContainerRegistry(IResourceBuilder<AzureCognitiveServicesProjectResource>, IResourceBuilder<AzureContainerRegistryResource>) Section titled WithContainerRegistry(IResourceBuilder<AzureCognitiveServicesProjectResource>, IResourceBuilder<AzureContainerRegistryResource>) extension IResourceBuilder<AzureCognitiveServicesProjectResource>
Associates a container registry with the Microsoft Foundry project resource for publishing and locating hosted agents.
public static class AzureCognitiveServicesProjectExtensions
{
public static IResourceBuilder<AzureCognitiveServicesProjectResource> WithContainerRegistry(
this IResourceBuilder<AzureCognitiveServicesProjectResource> builder,
IResourceBuilder<AzureContainerRegistryResource> registryBuilder)
{
// ...
}
}
builder IResourceBuilder<AzureCognitiveServicesProjectResource>
registryBuilder IResourceBuilder<AzureContainerRegistryResource>
WithContainerRegistry(IResourceBuilder<AzureCognitiveServicesProjectResource>, IContainerRegistry) Section titled WithContainerRegistry(IResourceBuilder<AzureCognitiveServicesProjectResource>, IContainerRegistry) extension IResourceBuilder<AzureCognitiveServicesProjectResource>
Associates a container registry with the Microsoft Foundry project resource for publishing and locating hosted agents.
public static class AzureCognitiveServicesProjectExtensions
{
public static IResourceBuilder<AzureCognitiveServicesProjectResource> WithContainerRegistry(
this IResourceBuilder<AzureCognitiveServicesProjectResource> builder,
IContainerRegistry registry)
{
// ...
}
}
builder IResourceBuilder<AzureCognitiveServicesProjectResource>
registry IContainerRegistry
This overload is not available in polyglot app hosts. Use the resource-builder overload instead.
WithKeyVault(IResourceBuilder<AzureCognitiveServicesProjectResource>, IResourceBuilder<AzureKeyVaultResource>) Section titled WithKeyVault(IResourceBuilder<AzureCognitiveServicesProjectResource>, IResourceBuilder<AzureKeyVaultResource>) extension IResourceBuilder<AzureCognitiveServicesProjectResource>
Adds a Key Vault connection to the Microsoft Foundry project.
public static class AzureCognitiveServicesProjectExtensions
{
public static IResourceBuilder<AzureCognitiveServicesProjectResource> WithKeyVault(
this IResourceBuilder<AzureCognitiveServicesProjectResource> builder,
IResourceBuilder<AzureKeyVaultResource> keyVault)
{
// ...
}
}
builder IResourceBuilder<AzureCognitiveServicesProjectResource> The resource builder for the Microsoft Foundry project.
keyVault IResourceBuilder<AzureKeyVaultResource> The Key Vault resource to associate with the project.
IResourceBuilder<AzureCognitiveServicesProjectResource> A reference to the ApplicationModel.IResourceBuilder`1 for chaining.
InvalidOperationException Thrown when the project already has a Key Vault connection configured.
WithReference(IResourceBuilder<TDestination>, IResourceBuilder<AzureCognitiveServicesProjectResource>) Section titled WithReference(IResourceBuilder<TDestination>, IResourceBuilder<AzureCognitiveServicesProjectResource>) extension IResourceBuilder<TDestination>
Adds a reference to a Microsoft Foundry project resource to the destination resource.
public static class AzureCognitiveServicesProjectExtensions
{
public static IResourceBuilder<TDestination> WithReference<TDestination>(
this IResourceBuilder<TDestination> builder,
IResourceBuilder<AzureCognitiveServicesProjectResource> project)
{
// ...
}
}
builder IResourceBuilder<TDestination>
project IResourceBuilder<AzureCognitiveServicesProjectResource>
This overload is not available in polyglot app hosts. Use the standard WithReference overload instead.