Deploy .NET Lambda functions with container images - AWS Lambda

Deploy .NET Lambda functions with container images

You can deploy your Lambda function code as a container image.

AWS provides the following resources to help you build a container image for your .NET function:

AWS provides base images for the x86_64 architecture for all supported .NET runtimes, and for the arm64 architecture for the .NET Core 3.1 and .NET 6.0 runtimes.

  • AWS base images for Lambda

    These base images are preloaded with a language runtime and other components that are required to run the image on Lambda. AWS provides a Dockerfile for each of the base images to help with building your container image.

  • Open-source runtime interface clients (RIC)

    If you use a community or private enterprise base image, you must add a Runtime interface client to the base image to make it compatible with Lambda.

  • Open-source runtime interface emulator (RIE)

    Lambda provides a runtime interface emulator for you to test your function locally. The base images for Lambda and base images for custom runtimes include the RIE. For other base images, you can download the RIE for testing your image locally.

The workflow for a function defined as a container image includes these steps:

  1. Build your container image using the resources listed in this topic.

  2. Upload the image to your Amazon ECR container registry.

  3. Create the Lambda function or update the function code to deploy the image to an existing function.

AWS base images for .NET

AWS provides the following base images for .NET:

Tags Runtime Operating system Dockerfile Deprecation


.NET Core 3.1 Amazon Linux 2 Dockerfile for .NET Core 3.1 on GitHub

Mar 31, 2023


.NET 6 Amazon Linux 2 Dockerfile for .NET 6 on GitHub


.NET 5 Amazon Linux 2 Dockerfile for .NET 5 on GitHub

Amazon ECR repository:

Using a .NET base image

For instructions on how to use a .NET base image, choose the usage tab on AWS Lambda base images for .NET in the Amazon ECR repository.

.NET runtime interface clients

Download the .NET runtime interface client from the AWS Lambda for .NET Core repository on GitHub.

Deploy the container image

For a new function, you deploy the container image when you create the function. For an existing function, if you rebuild the container image, you need to redeploy the image by updating the function code.