

AWS App Runner will no longer be open to new customers starting April 30, 2026. If you would like to use App Runner, sign up prior to that date. Existing customers can continue to use the service as normal. For more information, see [AWS App Runner availability change](https://docs.aws.amazon.com/apprunner/latest/dg/apprunner-availability-change.html).

# Using the .NET platform
<a name="service-source-code-net6"></a>

**Important**  
App Runner will end the support for **.NET 6** on December 1, 2025. For recommendations and more information, see [End of support for managed runtime versions](service-source-code.md#service-source-code.managed-platforms.eos).

The AWS App Runner .NET platform provides managed runtimes. Each runtime makes it easy to build and run containers with web applications based on a .NET version. When you use a .NET runtime, App Runner starts with a managed .NET runtime image. This image is based on the [Amazon Linux Docker image](https://hub.docker.com/_/amazonlinux) and contains the runtime package for a version of .NET and some tools and popular dependency packages. App Runner uses this managed runtime image as a base image, and adds your application code to build a Docker image. It then deploys this image to run your web service in a container.

 You specify a runtime for your App Runner service when you [create a service](manage-create.md) using the App Runner console or the [CreateService](https://docs.aws.amazon.com/apprunner/latest/api/API_CreateService.html) API operation. You can also specify a runtime as part of your source code. Use the `runtime` keyword in a [App Runner configuration file](config-file.md) that you include in your code repository. The naming convention of a managed runtime is *<language-name><major-version>*. 

For valid .NET runtime names and versions, see [.NET runtime release information](service-source-code-dotnet-releases.md).

App Runner updates the runtime for your service to the latest version on every deployment or service update. If your application requires a specific version of a managed runtime, you can specify it using the `runtime-version` keyword in the [App Runner configuration file](config-file.md). You can lock to any level of version, including a major or minor version. App Runner only makes lower-level updates to the runtime of your service.

Version syntax for .NET runtimes: `major[.minor[.patch]]`

For example: `6.0.9`

The following examples demonstrate version locking:
+ `6.0` – Lock the major and minor versions. App Runner updates only patch versions.
+ `6.0.9` – Lock to a specific patch version. App Runner doesn't update your runtime version.

**Topics**
+ [.NET runtime configuration](#service-source-code-net6.config)
+ [.NET runtime examples](#service-source-code-net6.examples)
+ [.NET runtime release information](service-source-code-dotnet-releases.md)

## .NET runtime configuration
<a name="service-source-code-net6.config"></a>

When you choose a managed runtime, you must also configure, as a minimum, build and run commands. You configure them while [creating](manage-create.md) or [updating](manage-configure.md) your App Runner service. You can do this using one of the following methods:
+ **Using the App Runner console** – Specify the commands in the **Configure build** section of the creation process or configuration tab.
+ **Using the App Runner API** – Call the [CreateService](https://docs.aws.amazon.com/apprunner/latest/api/API_CreateService.html) or [UpdateService](https://docs.aws.amazon.com/apprunner/latest/api/API_UpdateService.html) API operation. Specify the commands using the `BuildCommand` and `StartCommand` members of the [CodeConfigurationValues](https://docs.aws.amazon.com/apprunner/latest/api/API_CodeConfigurationValues.html) data type.
+ **Using a [configuration file](config-file.md)** – Specify one or more build commands in up to three build phases, and a single run command that serves to start your application. There are additional optional configuration settings.

Providing a configuration file is optional. When you create an App Runner service using the console or the API, you specify if App Runner gets your configuration settings directly when it's created or from a configuration file.

## .NET runtime examples
<a name="service-source-code-net6.examples"></a>

The following examples show App Runner configuration files for building and running a .NET service. The last example is the source code for a complete .NET application that you can deploy to a .NET runtime service.

**Note**  
The runtime version that's used in these examples is *6.0.9*. You can replace it with a version you want to use. For latest supported .NET runtime version, see [.NET runtime release information](service-source-code-dotnet-releases.md).

### Minimal .NET configuration file
<a name="service-source-code-net6.examples.minimal"></a>

This example shows a minimal configuration file that you can use with a .NET managed runtime. For the assumptions that App Runner makes with a minimal configuration file, see [Configuration file examples](config-file-examples.md#config-file-examples.managed).

**Example apprunner.yaml**  

```
version: 1.0
runtime: dotnet6
build:
  commands:    
    build:
      - dotnet publish -c Release -o out
run:                              
  command: dotnet out/HelloWorldDotNetApp.dll
```

### Extended .NET configuration file
<a name="service-source-code-net6.examples.extended"></a>

This example shows the use of all configuration keys with a .NET managed runtime.

**Note**  
The runtime version that's used in these examples is *6.0.9*. You can replace it with a version you want to use. For latest supported .NET runtime version, see [.NET runtime release information](service-source-code-dotnet-releases.md).

**Example apprunner.yaml**  

```
version: 1.0
runtime: dotnet6
build:
  commands:
    pre-build:
      - scripts/prebuild.sh
    build:
      - dotnet publish -c Release -o out
    post-build:
      - scripts/postbuild.sh
  env:
    - name: MY_VAR_EXAMPLE
      value: "example"    
run:
  runtime-version: 6.0.9
  command: dotnet out/HelloWorldDotNetApp.dll
  network:
    port: 5000
    env: APP_PORT
  env:
    - name: ASPNETCORE_URLS
      value: "http://*:5000"
```

### Complete .NET application source
<a name="service-source-code-net6.examples.end2end"></a>

This example shows the source code for a complete .NET application that you can deploy to a .NET runtime service.

**Note**  
 Run following command to create a simple .NET 6 web app: ` dotnet new web --name HelloWorldDotNetApp -f net6.0`
 Add the `apprunner.yaml` to the created .NET 6 web app. 

**Example HelloWorldDotNetApp**  

```
version: 1.0
runtime: dotnet6
build:
  commands:
    build:
      - dotnet publish -c Release -o out
run:
  command: dotnet out/HelloWorldDotNetApp.dll
  network:
    port: 5000
    env: APP_PORT
  env:
    - name: ASPNETCORE_URLS
      value: "http://*:5000"
```

# .NET runtime release information
<a name="service-source-code-dotnet-releases"></a>

**Important**  
App Runner will end the support for **.NET 6** on December 1, 2025. For recommendations and more information, see [End of support for managed runtime versions](service-source-code.md#service-source-code.managed-platforms.eos).

This topic lists the full details for the .NET runtime versions that App Runner supports.


**Supported runtime versions — original App Runner build**  
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/apprunner/latest/dg/service-source-code-dotnet-releases.html)

**Note**  
App Runner provides a revised build process for specific major runtimes that have been released more recently. Because of this you'll see references to *revised App Runner build* and *original App Runner build* in certain sections of this document. For more information, see [Managed runtime versions and the App Runner build](service-source-code.md#service-source-code.build-detail).