Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
When you plan and develop your individual functions to run in Azure Functions, you're typically focused on the code itself. Azure Functions makes it easy to deploy just your code project to a function app in Azure. When you deploy your project to a Linux function app, your code runs in a container that is created for you automatically and seamlessly integrates with Functions management tools.
Functions also supports containerized function app deployments. In a containerized deployment, you create your own function app instance in a local Docker container from a supported based image. You can then deploy this containerized function app to a hosting environment in Azure. Creating your own function app container lets you customize or otherwise control the immediate runtime environment of your function code.
Important
When you create your own containers, you're required to keep the base image of your container updated to the latest supported base image. Supported base images for Azure Functions are language-specific. See the Azure Functions base image repos.
The Functions team is committed to publishing monthly updates for these base images. Regular updates include the latest minor version updates and security fixes for both the Functions runtime and languages. You should regularly update your container from the latest base image and redeploy the updated version of your container. For more information, see Maintaining custom containers.
Container hosting options
There are several options for hosting your containerized function apps in Azure:
Hosting option | Benefits |
---|---|
Azure Container Apps | Azure Functions provides integrated support for developing, deploying, and managing containerized function apps on Azure Container Apps. This integration enables you to manage your apps using the same Functions tools and pages in the Azure portal. Use Azure Container Apps to host your function app container in the same environment as other microservices, APIs, websites, workflows, or other container hosted programs. Container Apps hosting lets you run your functions in a managed Kubernetes-based environment with built-in support for open-source monitoring, mTLS, Dapr, and KEDA. Supports scale-to-zero and provides a serverless pay-for-what-you-use hosting model. You can also request dedicated hardware, even GPUs, by using workload profiles. Recommended hosting option for containerized function apps n Azure. |
Azure Arc-enabled Kubernetes clusters (preview) | You can host your function apps on Azure Arc-enabled Kubernetes clusters as either a code-only deployment or in a custom Linux container. Azure Arc lets you attach Kubernetes clusters so that you can manage and configure them in Azure. Hosting Azure Functions containers on Azure Arc-enabled Kubernetes clusters is currently in preview. For more information, see Working with containers and Azure Functions. |
Azure Functions | You can host your containerized function apps in Azure Functions by running the container in an Elastic Premium or an App Service (Dedicated) plan. Use Container Apps hosting for rich container support from Container Apps. Premium plan hosting provides you with the benefits of dynamic scaling. You might want to use Dedicated plan hosting to take advantage of existing unused App Service plan resources. |
Kubernetes | Because the Azure Functions runtime provides flexibility in hosting where and how you want, you can host and manage your function app containers directly in Kubernetes clusters. KEDA (Kubernetes-based Event Driven Autoscaling) pairs seamlessly with the Azure Functions runtime and tooling to provide event driven scale in Kubernetes. Important: Kubernetes hosting of your containerized function apps, either by using KEDA or by direct deployment, is an open-source effort that you can use free of cost. Best-effort support for this hosting scenario is provided only by contributors and by the community. You're responsible for maintaining your own function app containers in a cluster, even when deploying them to Azure Kubernetes Service (AKS). |
Feature support comparison
The degree to which various features and behaviors of Azure Functions are supported when running your function app in a container depends on the container hosting option you choose.
Feature/behavior | Container Apps (integrated) | Container Apps (direct) | Premium plan | Dedicated plan | Kubernetes |
---|---|---|---|---|---|
Product support | Yes | No | Yes | Yes | No |
Functions portal integration | No | No | Yes | Yes | No |
Event-driven scaling | Yes5 | Yes (scale rules) | Yes | No | No |
Maximum scale (instances) | 10001 | 10001 | 1002 | 10-303 | Varies by cluster |
Scale-to-zero instances | Yes | Yes | No | No | KEDA |
Execution time limit | Unbounded6 | Unbounded6 | Unbounded7 | Unbounded8 | None |
Core Tools deployment | No | No | No | No | func kubernetes |
Revisions | Yes | Yes | No | No | No |
Deployment slots | No | No | Yes | Yes | No |
Streaming logs | Yes | Yes | Yes | Yes | No |
Console access | Yes | Yes | Yes (using Kudu) | Yes (using Kudu) | Yes (in pods using kubectl ) |
Cold start mitigation | Minimum replicas | Scale rules | Always-ready/pre-warmed instances | n/a | n/a |
App Service authentication | Yes | Yes | Yes | Yes | No |
Custom domain names | Yes | Yes | Yes | Yes | No |
Private key certificates | Yes | Yes | Yes | Yes | No |
Virtual networks | Yes | Yes | Yes | Yes | Yes |
Availability zones | Yes | Yes | Yes | Yes | Yes |
Diagnostics | Yes | Yes | Yes | Yes | No |
Dedicated hardware | Yes (workload profiles) | Yes (workload profiles) | No | Yes | Yes |
Dedicated GPUs | Yes (workload profiles) | Yes (workload profiles) | No | No | Yes |
Configurable memory/CPU count | Yes | Yes | No | No | Yes |
"Free grant" option | Yes | Yes | No | No | No |
Pricing details | Container Apps billing | Container Apps billing | Premium plan billing | Dedicated plan billing | AKS pricing |
Service name requirements | 2-32 characters: limited to lowercase letters, numbers, and hyphens. Must start with a letter and end with an alphanumeric character. | 2-32 characters: limited to lowercase letters, numbers, and hyphens. Must start with a letter and end with an alphanumeric character. | Fewer than 64 characters: limited to alphanumeric characters and hyphens. Can't start with or end in a hyphen. | Fewer than 64 characters: limited to alphanumeric characters and hyphens. Can't start with or end in a hyphen. | Fewer than 253 characters: limited to alphanumeric characters and hyphens. Must start and end with an alphanumeric character. |
- On Container Apps, the default is 10 instances, but you can set the maximum number of replicas, which has an overall maximum of 1000. This setting is honored as long as there's enough cores quota available. When you create your function app from the Azure portal, you're limited to 300 instances.
- In some regions, Linux apps on a Premium plan can scale to 100 instances. For more information, see the Premium plan article.
- For specific limits for the various App Service plan options, see the App Service plan limits.
- Requires KEDA; supported by most triggers. To learn which triggers support event-driven scaling, see Considerations for Container Apps hosting.
- When the minimum number of replicas is set to zero, the default timeout depends on the specific triggers used in the app.
- There's no maximum execution timeout duration enforced. However, the grace period given to a function execution is 60 minutes during scale in, and a grace period of 10 minutes is given during platform updates.
- Requires the App Service plan be set to Always On. A grace period of 10 minutes is given during platform updates.
Maintaining custom containers
When creating your own containers, you're required to keep the base image of your container updated to the latest supported base image. Supported base images for Azure Functions are language-specific and are found in the Azure Functions base image repos.
The Functions team is committed to publishing monthly updates for these base images. Regular updates include the latest minor version updates and security fixes for both the Functions runtime and languages. You should regularly update your container from the latest base image and redeploy the updated version of your container.
Choose your base image based on the language stack you're using in your function app. The following table provides examples for each stack. In general, the tag should start with 4-
to indicate the V4 Functions runtime. When new minor versions are released, this tag will be updated to point to the new version. As you periodically rebuild your custom image, you will pull the new versions through that same tag, allowing your app to have the same updates. You shouldn't use tags that specify minor runtime versions, as these will not receive updates, and your app will potentially remain on an unpatched version, no matter how often you rebuild your custom image.
Language Stack | Example recommended base image tags |
---|---|
.NET (isolated worker model) | mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0 ormcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0-appservice (These examples target .NET 8. Select the appropriate image for the .NET version you need.) |
.NET (legacy in-process model) | mcr.microsoft.com/azure-functions/dotnet:4-dotnet8.0 ormcr.microsoft.com/azure-functions/dotnet:4-dotnet8.0-appservice (Support will end for the in-process model on November 10, 2026. You should migrate to the isolated worker model as soon as possible.) |
Java | mcr.microsoft.com/azure-functions/java:4-java21 ormcr.microsoft.com/azure-functions/java:4-java21-appservice (These examples target Java 21. Select the appropriate image for the Java version you need.) |
Node.js (JavaScript or TypeScript) | mcr.microsoft.com/azure-functions/node:4-node22 ormcr.microsoft.com/azure-functions/node:4-node22-appservice (These examples target Node.js 22. Select the appropriate image for the Node.js version you need.) |
PowerShell | mcr.microsoft.com/azure-functions/powershell:4-powershell7.4 ormcr.microsoft.com/azure-functions/powershell:4-powershell7.4-appservice (These examples target PowerShell 7.4. Select the appropriate image for the PowerShell version you need.) |
Python | mcr.microsoft.com/azure-functions/python:4-python3.12 ormcr.microsoft.com/azure-functions/python:4-python3.12-appservice (These examples target Python 3.12. Select the appropriate image for the Python version you need.) |
Custom handlers / other | mcr.microsoft.com/azure-functions/base:4 ormcr.microsoft.com/azure-functions/base:4-appservice |
Base images ending in -appservice
enable SSH and remote debugging from the platform. Unless you need these capabilities, you can use the base images without the -appservice
suffix.
Important
It isn't sufficient to just have one of the above tags in your Dockerfile. You need to regularly pull the latest image from that tag so that your custom image can be rebuilt to include the latest updates. If you don't pull the latest image and rebuild, your app will continue to run on the old base image.
When you create or deploy your own containerized app using a custom image, you're responsible for making sure that your custom image staying up-to-date with our released base images. In addition to new features and improvements, these base image updates can also include security updates that are critical for your app. To ensure your app is protected, make sure you're staying up to date. You should regularly pull the latest version of the base image, rebuild your custom container image, and redeploy your app to use it.
In some cases, we're required to make platform-level changes that could mean that an app in a custom container using an old base image might stop working properly. For such major changes, we roll out updated images well in advance so that apps that take regular updates aren't negatively impacted. To avoid potential problems with your apps running in custom containers, make sure you don't fall too far behind the latest minor version released. During a support case, should we determine that your app is experiencing problems because it's on an older or unsupported version, we do request that you update your container to the latest base image version before continuing with support.
Getting started
Use these links to get started working with Azure Functions in Linux containers:
I want to... | See article: |
---|---|
Create my first containerized functions | Create a function app in a local Linux container |
Create and deploy functions to Azure Container Apps | Create your first containerized functions on Azure Container Apps |
Create and deploy containerized functions to Azure Functions | Create your first containerized Azure Functions |