Skip to content
DocsTry Aspire
DocsTry

AzureCognitiveServicesProjectExtensions Methods

ClassMethods7 members
Extension methods for adding Microsoft Foundry project resources to the distributed application model.
AddCapabilityHost(IResourceBuilder<AzureCognitiveServicesProjectResource>, string)Section titled AddCapabilityHost(IResourceBuilder<AzureCognitiveServicesProjectResource>, string)extensionCapabilityHostBuilder
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)
{
// ...
}
}
builderIResourceBuilder<AzureCognitiveServicesProjectResource>The resource builder for the Microsoft Foundry project.
namestringThe name of the capability host.
CapabilityHostBuilderA 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)extensionIResourceBuilder<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)
{
// ...
}
}
builderIResourceBuilder<AzureCognitiveServicesProjectResource>Aspire resource builder for a project
namestringName to give the model deployment
modelFoundryModelThe 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)extensionIResourceBuilder<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)
{
// ...
}
}
builderIResourceBuilder<AzureCognitiveServicesProjectResource>
namestring
modelNamestring
modelVersionstring
formatstring
AddProject(IResourceBuilder<FoundryResource>, string)Section titled AddProject(IResourceBuilder<FoundryResource>, string)extensionIResourceBuilder<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)
{
// ...
}
}
builderIResourceBuilder<FoundryResource>The ApplicationModel.IResourceBuilder`1 for the parent Microsoft Foundry account resource.
namestringThe 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>)extensionIResourceBuilder<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)
{
// ...
}
}
builderIResourceBuilder<AzureCognitiveServicesProjectResource>The resource builder for the Microsoft Foundry project.
appInsightsIResourceBuilder<AzureApplicationInsightsResource>The Application Insights resource to associate with the project.
IResourceBuilder<AzureCognitiveServicesProjectResource>A reference to the ApplicationModel.IResourceBuilder`1 for chaining.
WithKeyVault(IResourceBuilder<AzureCognitiveServicesProjectResource>, IResourceBuilder<AzureKeyVaultResource>)Section titled WithKeyVault(IResourceBuilder<AzureCognitiveServicesProjectResource>, IResourceBuilder<AzureKeyVaultResource>)extensionIResourceBuilder<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)
{
// ...
}
}
builderIResourceBuilder<AzureCognitiveServicesProjectResource>The resource builder for the Microsoft Foundry project.
keyVaultIResourceBuilder<AzureKeyVaultResource>The Key Vault resource to associate with the project.
IResourceBuilder<AzureCognitiveServicesProjectResource>A reference to the ApplicationModel.IResourceBuilder`1 for chaining.
InvalidOperationExceptionThrown when the project already has a Key Vault connection configured.
WithReference(IResourceBuilder<TDestination>, IResourceBuilder<AzureCognitiveServicesProjectResource>)Section titled WithReference(IResourceBuilder<TDestination>, IResourceBuilder<AzureCognitiveServicesProjectResource>)extensionIResourceBuilder<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)
{
// ...
}
}
builderIResourceBuilder<TDestination>
projectIResourceBuilder<AzureCognitiveServicesProjectResource>
This overload is not available in polyglot app hosts. Use the standard WithReference overload instead.