共用方式為


AzureContainerAppContainerExtensions.PublishAsAzureContainerApp<T> Method

Definition

Publishes the specified container resource as a container app.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> PublishAsAzureContainerApp<T> (this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> container, Action<Aspire.Hosting.Azure.AzureResourceInfrastructure,Azure.Provisioning.AppContainers.ContainerApp> configure) where T : Aspire.Hosting.ApplicationModel.ContainerResource;
static member PublishAsAzureContainerApp : Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)> * Action<Aspire.Hosting.Azure.AzureResourceInfrastructure, Azure.Provisioning.AppContainers.ContainerApp> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)> (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)
<Extension()>
Public Function PublishAsAzureContainerApp(Of T As ContainerResource) (container As IResourceBuilder(Of T), configure As Action(Of AzureResourceInfrastructure, ContainerApp)) As IResourceBuilder(Of T)

Type Parameters

T

The type of the container resource.

Parameters

container
IResourceBuilder<T>

The container resource builder.

configure
Action<AzureResourceInfrastructure,ContainerApp>

The configuration action for the container app.

Returns

The updated container resource builder.

Examples

builder.AddContainer("name", "image").PublishAsAzureContainerApp((infrastructure, app) =>
{
    // Configure the container app here
});

Remarks

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.

Applies to