Skip to content
Docs Try Aspire

AzureContainerAppExecutableExtensions Methods

Class Methods 1 member
Provides extension methods for publishing executable resources (with docker files) as container apps in Azure.
PublishAsAzureContainerApp(IResourceBuilder<T>, Action<AzureResourceInfrastructure, ContainerApp>) Section titled PublishAsAzureContainerApp(IResourceBuilder<T>, Action<AzureResourceInfrastructure, ContainerApp>) extension IResourceBuilder<T>
Publishes the specified container resource as a container app.
public static class AzureContainerAppExecutableExtensions
{
public static IResourceBuilder<T> PublishAsAzureContainerApp<T>(
this IResourceBuilder<T> executable,
Action<AzureResourceInfrastructure, ContainerApp> configure)
{
// ...
}
}
executable IResourceBuilder<T> The container resource builder.
configure Action<AzureResourceInfrastructure, ContainerApp> The configuration action for the container app.
IResourceBuilder<T> The updated container resource builder.
This method checks if the application is in publish mode. If it is, it adds the necessary infrastructure for container apps and applies the provided configuration action to the container app.
builder.AddNpmApp(
"name",
"image").PublishAsAzureContainerApp((infrastructure, app) =>
{
// Configure the container app here
});