AzureContainerAppContainerExtensions.PublishAsAzureContainerApp<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.