Skip to content

Commit 3f2f6c5

Browse files
Merge pull request #267442 from ggailey777/containers
[Functions][ACA] Initial pre-GA updates
2 parents 224c1f5 + 24d2c0a commit 3f2f6c5

File tree

3 files changed

+114
-53
lines changed

3 files changed

+114
-53
lines changed

articles/azure-functions/functions-container-apps-hosting.md

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,49 @@
11
---
22
title: Azure Container Apps hosting of Azure Functions
3-
description: Learn about how you can use Azure Container Apps to host containerized function apps in Azure Functions.
4-
ms.date: 11/15/2023
3+
description: Learn about how you can use Azure Functions on Azure Container Apps to host and manage containerized function apps in Azure.
4+
ms.date: 02/27/2024
55
ms.topic: conceptual
66
ms.custom: references_regions, build-2023
7-
# Customer intent: As a cloud developer, I want to learn more about hosting my function apps in Linux containers by using Azure Container Apps.
7+
# Customer intent: As a cloud developer, I want to learn more about hosting my function apps in Linux containers managed by Azure Container Apps.
88
---
99

1010
# Azure Container Apps hosting of Azure Functions
1111

12-
Azure Functions provides integrated support for developing, deploying, and managing containerized function apps on [Azure Container Apps](../container-apps/overview.md). Use Azure Container Apps to host your function app containers when you need to run your event-driven functions in Azure in the same environment as other microservices, APIs, websites, workflows or any container hosted programs. Container Apps hosting lets you run your functions in a Kubernetes-based environment with built-in support for open-source monitoring, mTLS, Dapr, and KEDA
12+
Azure Functions provides integrated support for developing, deploying, and managing containerized function apps on [Azure Container Apps](../container-apps/overview.md). Use Azure Container Apps to host your function app containers when you need to run your event-driven functions in Azure in the same environment as other microservices, APIs, websites, workflows, or any container hosted programs. Container Apps hosting lets you run your functions in a Kubernetes-based environment with built-in support for open-source monitoring, mTLS, Dapr, and KEDA.
1313

1414
[!INCLUDE [functions-container-apps-preview](../../includes/functions-container-apps-preview.md)]
1515

1616
Integration with Container Apps lets you use the existing functions programming model to write function code in your preferred programming language or framework supported by Azure Functions. You still get the Functions triggers and bindings with event-driven scaling. Container Apps uses the power of the underlying Azure Kubernetes Service (AKS) while removing the complexity of having to work with Kubernetes APIs.
1717

18-
This integration also means that you can use existing Functions client tools and the portal to create containers, deploy function app containers to Container Apps, and configure continuous deployment. Network and observability configurations are defined at the Container App environment level and apply to all microservices running in a Container Apps environment, including your function app. You also get the other cloud-native capabilities of Container Apps, including KEDA, Dapr, Envoy. You can still use Application Insights to monitor your functions executions.
18+
This integration also means that you can use existing Functions client tools and the Azure portal to create containers, deploy function app containers to Container Apps, and configure continuous deployment. Network and observability configurations are defined at the Container App environment level and apply to all microservices running in a Container Apps environment, including your function app. You also get the other cloud-native capabilities of Container Apps, including KEDA, Dapr, Envoy. You can still use Application Insights to monitor your functions executions.
1919

20-
## Deploying Azure Functions to Container Apps
20+
## Hosting and workload profiles
2121

22-
In the current preview, you must deploy your functions code in a Linux container that you create. Functions maintains a set of [language-specific base images](https://mcr.microsoft.com/catalog?search=functions) that you can use to generate your containerized function apps. When you create a Functions project using [Azure Functions Core Tools](./functions-run-local.md) and include the [`--docker` option](./functions-core-tools-reference.md#func-init), Core Tools also generates a Dockerfile that you can use to create your container from the correct base image.
22+
There are two primary hosting plans for Container Apps, a serverless [Consumption plan](../container-apps/plans.md#consumption) and a [Dedicated plan](../container-apps/plans.md#dedicated), which uses workload profiles to better control your deployment resources. A workload profile determines the amount of compute and memory resources available to container apps deployed in an environment. These profiles are configured to fit the different needs of your applications. The Consumption workload profile is the default profile added to every Workload profiles environment type. You can add Dedicated workload profiles to your environment as you create an environment or after it's created. To learn more about workload profiles, see [Workload profiles in Azure Container Apps](../container-apps/workload-profiles-overview.md).
2323

24-
Azure Functions currently supports the following methods of deployment to Azure Container Apps:
24+
Container Apps hosting of containerized function apps is supported in all [regions that support Container Apps](https://azure.microsoft.com/explore/global-infrastructure/products-by-region/?products=container-apps).
25+
26+
If your app doesn't have a specific hardware requirements, you can run your environment either in a Consumption plan or in a Dedicated plan using the default Consumption workload profile. When running functions on Container Apps, you're charged only for the Container Apps usage. For more information, see the [Azure Container Apps pricing page](https://azure.microsoft.com/pricing/details/container-apps/).
27+
28+
Azure Functions on Azure Container Apps supports GPU-enabled hosting in the Dedicated plan with workload profiles.
29+
30+
To learn how to create and deploy a function app container to Container Apps in the default Consumption plan, see [Create your first containerized functions on Azure Container Apps](functions-deploy-container-apps.md).
31+
32+
To learn how to create a Container Apps environment with workload profiles and deploy a function app container to a specific workload, see [Container Apps workload profiles](functions-how-to-custom-container.md#container-apps-workload-profiles).
33+
34+
## Functions in containers
35+
36+
To use Container Apps hosting, your functions code must run in a Linux container that you create and maintain. Functions maintains a set of [language-specific base images](https://mcr.microsoft.com/catalog?search=functions) that you can use to generate your containerized function apps.
37+
38+
When you create a Functions project using [Azure Functions Core Tools](./functions-run-local.md) and include the [`--docker` option](./functions-core-tools-reference.md#func-init), Core Tools generates the Dockerfile with the correct base image, which you can use as a starting point when creating your container.
39+
40+
[!INCLUDE [functions-linux-custom-container-note](../../includes/functions-linux-custom-container-note.md)]
41+
42+
When you make changes to your functions code, you must rebuild and republish your container image. For more information, see [Update an image in the registry](functions-how-to-custom-container.md#update-an-image-in-the-registry).
43+
44+
## Deployment options
45+
46+
Azure Functions currently supports the following methods of deploying a containerized function app to Azure Container Apps:
2547

2648
+ [Azure CLI](./functions-deploy-container-apps.md)
2749
+ Azure portal
@@ -31,12 +53,6 @@ Azure Functions currently supports the following methods of deployment to Azure
3153
+ [Bicep templates](https://github.com/Azure/azure-functions-on-container-apps/tree/main/samples/Biceptemplates)
3254
+ [Azure Functions Core Tools](functions-run-local.md#deploy-containers)
3355

34-
To learn how to create and deploy a function app container to Container Apps using the Azure CLI, see [Create your first containerized functions on Azure Container Apps](functions-deploy-container-apps.md).
35-
36-
[!INCLUDE [functions-linux-custom-container-note](../../includes/functions-linux-custom-container-note.md)]
37-
38-
When you make changes to your functions code, you must rebuild and republish your container image. For more information, see [Update an image in the registry](functions-how-to-custom-container.md#update-an-image-in-the-registry).
39-
4056
## Configure scale rules
4157

4258
Azure Functions on Container Apps is designed to configure the scale parameters and rules as per the event target. You don't need to worry about configuring the KEDA scaled objects. You can still set minimum and maximum replica count when creating or modifying your function app. The following Azure CLI command sets the minimum and maximum replica count when creating a new function app in a Container Apps environment from an Azure Container Registry:
@@ -49,30 +65,24 @@ The following command sets the same minimum and maximum replica count on an exis
4965

5066
```azurecli
5167
az functionapp config container set --name <APP_NAME> --resource-group <MY_RESOURCE_GROUP> --max-replicas 15 --min-replicas 1
52-
```
68+
```
69+
70+
## Managed resource groups
71+
72+
Azure Function on Container Apps run your functionized container resources in specially managed resource groups, which helps protect the consistency of your apps by preventing unintended or unauthorized modification or deletion of resources in the managed group by users, groups, or service principles. This managed resource group is created for you the first time you create function app resources in a Container Apps environment. Container Apps resources required by your containerized function app run in this managed resource group, and any other function apps that are created in the same environment use this existing group. A managed resource group gets removed automatically after all function app container resources are removed from the environment. While the managed resource group is visible, any attempts to modify or remove the managed resource group result in an error. To remove a managed resource group from an environment, remove all of the function app container resources and it gets removed for you. If you run into any issues with these managed resource groups, you should contact support.
5373

5474
## Considerations for Container Apps hosting
5575

5676
Keep in mind the following considerations when deploying your function app containers to Container Apps:
5777

58-
+ Container Apps support for Functions is currently in preview and is only available in the following regions:
59-
+ Australia East
60-
+ Central US
61-
+ East US
62-
+ East US 2
63-
+ North Europe
64-
+ South Central US
65-
+ UK South
66-
+ West Europe
67-
+ West US 3
68-
+ When your container is hosted in a [Consumption + Dedicated plan structure](../container-apps/plans.md#consumption-dedicated), only the default Consumption plan is currently supported. Dedicated plans in this structure aren't yet supported for Functions. When running functions on Container Apps, you're charged only for the Container Apps usage. For more information, see the [Azure Container Apps pricing page](https://azure.microsoft.com/pricing/details/container-apps/).
6978
+ While all triggers can be used, only the following triggers can dynamically scale (from zero instances) when running on Container Apps:
7079
+ HTTP
7180
+ Azure Queue Storage
7281
+ Azure Service Bus
7382
+ Azure Event Hubs
74-
+ Kafka*
75-
\*The protocol value of `ssl` isn't supported when hosted on Container Apps. Use a [different protocol value](functions-bindings-kafka-trigger.md?pivots=programming-language-csharp#attributes).
83+
+ Kafka<sup>*</sup>
84+
+ Timer
85+
<sup>*</sup>The protocol value of `ssl` isn't supported when hosted on Container Apps. Use a [different protocol value](functions-bindings-kafka-trigger.md?pivots=programming-language-csharp#attributes).
7686
+ For the built-in Container Apps [policy definitions](../container-apps/policy-reference.md#policy-definitions), currently only environment-level policies apply to Azure Functions containers.
7787
+ When using Container Apps, you don't have direct access to the lower-level Kubernetes APIs.
7888
+ The `containerapp` extension conflicts with the `appservice-kube` extension in Azure CLI. If you have previously published apps to Azure Arc, run `az extension list` and make sure that `appservice-kube` isn't installed. If it is, you can remove it by running `az extension remove -n appservice-kube`.

0 commit comments

Comments
 (0)