# AzureContainerAppExecutableExtensions Methods

- Package: [Aspire.Hosting.Azure.AppContainers](/reference/api/csharp/aspire.hosting.azure.appcontainers.md)
- Type: [AzureContainerAppExecutableExtensions](/reference/api/csharp/aspire.hosting.azure.appcontainers/azurecontainerappexecutableextensions.md)
- Kind: `Methods`
- Members: `1`

Provides extension methods for publishing executable resources (with docker files) as container apps in Azure.

## PublishAsAzureContainerApp(IResourceBuilder<T>, Action<AzureResourceInfrastructure, ContainerApp>)

- Name: `PublishAsAzureContainerApp(IResourceBuilder<T>, Action<AzureResourceInfrastructure, ContainerApp>)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<T>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.AppContainers/AzureContainerAppExecutableExtensions.cs#L38-L48)

Publishes the specified container resource as a container app.

```csharp
public static class AzureContainerAppExecutableExtensions
{
    public static IResourceBuilder<T> PublishAsAzureContainerApp<T>(
        this IResourceBuilder<T> executable,
        Action<AzureResourceInfrastructure, ContainerApp> configure)
    {
        // ...
    }
}
```

## Parameters

- `executable` (`IResourceBuilder<T>`)
  The container resource builder.
- `configure` (`Action<AzureResourceInfrastructure, ContainerApp>`)
  The configuration action for the container app.

## Returns

`IResourceBuilder<T>` -- The updated container resource builder.

## 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.

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

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.
