Skip to content

Commit 200bf08

Browse files
Merge pull request #244370 from ggailey777/azurecontainerapps
[Functions] Functions + ACA Ramya feedback
2 parents b57857f + be99bcb commit 200bf08

File tree

4 files changed

+134
-66
lines changed

4 files changed

+134
-66
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Azure Container Apps hosting of Azure Functions
33
description: Learn about how you can use Azure Container Apps to host containerized function apps in Azure Functions.
4-
ms.date: 05/04/2023
4+
ms.date: 07/30/2023
55
ms.topic: conceptual
66
ms.custom: references_regions, build-2023
77
# Customer intent: As a cloud developer, I want to learn more about hosting my function apps in Linux containers by using Azure Container Apps.
@@ -59,12 +59,12 @@ Keep in mind the following considerations when deploying your function app conta
5959
+ Australia East
6060
+ Central US
6161
+ East US
62-
+ East Us 2
62+
+ East US 2
6363
+ North Europe
6464
+ South Central US
6565
+ UK South
6666
+ West Europe
67-
+ West US3
67+
+ West US 3
6868
+ 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/).
6969
+ While all triggers can be used, only the following triggers can dynamically scale (from zero instances) when running on Container Apps:
7070
+ HTTP

articles/azure-functions/functions-core-tools-reference.md

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Azure Functions Core Tools reference
33
description: Reference documentation that supports the Azure Functions Core Tools (func.exe).
44
ms.topic: reference
5-
ms.date: 07/13/2021
5+
ms.date: 07/30/2023
66
---
77

88
# Azure Functions Core Tools reference
@@ -15,6 +15,7 @@ Core Tools commands are organized into the following contexts, each providing a
1515
| ----- | ----- |
1616
| [`func`](#func-init) | Commands used to create and run functions on your local computer. |
1717
| [`func azure`](#func-azure-functionapp-fetch-app-settings) | Commands for working with Azure resources, including publishing. |
18+
| [`func azurecontainerapps`](#func-azurecontainerapps-deploy) | Deploy containerized function app to Azure Container Apps. |
1819
| [`func durable`](#func-durable-delete-task-hub) | Commands for working with [Durable Functions](./durable/durable-functions-overview.md). |
1920
| [`func extensions`](#func-extensions-install) | Commands for installing and managing extensions. |
2021
| [`func kubernetes`](#func-kubernetes-deploy) | Commands for working with Kubernetes and Azure Functions. |
@@ -163,7 +164,7 @@ func host start
163164
| **`--timeout`** | The timeout for the Functions host to start, in seconds. Default: 20 seconds.|
164165
| **`--useHttps`** | Bind to `https://localhost:{port}` rather than to `http://localhost:{port}`. By default, this option creates a trusted certificate on your computer.|
165166

166-
In version 1.x, you can also use the [`func run` command](#func-run) to run a specific function and pass test data to it.
167+
In version 1.x, you can also use the [`func run`](#func-run) command to run a specific function and pass test data to it.
167168

168169
---
169170

@@ -209,7 +210,7 @@ To learn more, see [Enable streaming logs](functions-run-local.md#enable-streami
209210
Deploys a Functions project to an existing function app resource in Azure.
210211

211212
```command
212-
func azure functionapp publish <FunctionAppName>
213+
func azure functionapp publish <APP_NAME>
213214
```
214215

215216
For more information, see [Deploy project files](functions-run-local.md#project-file-deployment).
@@ -220,20 +221,25 @@ The following publish options apply, based on version:
220221

221222
| Option | Description |
222223
| ------------ | -------------------------------------- |
224+
| **`--access-token`** | Let's you use a specific access token when performing authenticated azure actions. |
225+
| **`--access-token-stdin `** | Reads a specific access token from a standard input. Use this when reading the token directly from a previous command such as [`az account get-access-token`](/cli/azure/account#az-account-get-access-token). |
223226
| **`--additional-packages`** | List of packages to install when building native dependencies. For example: `python3-dev libevent-dev`. |
224227
| **`--build`**, **`-b`** | Performs build action when deploying to a Linux function app. Accepts: `remote` and `local`. |
225228
| **`--build-native-deps`** | Skips generating the `.wheels` folder when publishing Python function apps. |
226229
| **`--csx`** | Publish a C# script (.csx) project. |
230+
| **`--dotnet-cli-params`** | When publishing compiled C# (.csproj) functions, the core tools calls `dotnet build --output bin/publish`. Any parameters passed to this are appended to the command line. |
227231
| **`--force`** | Ignore prepublishing verification in certain scenarios. |
228-
| **`--dotnet-cli-params`** | When publishing compiled C# (.csproj) functions, the core tools calls `dotnet build --output bin/publish`. Any parameters passed to this will be appended to the command line. |
229232
|**`--list-ignored-files`** | Displays a list of files that are ignored during publishing, which is based on the `.funcignore` file. |
230233
| **`--list-included-files`** | Displays a list of files that are published, which is based on the `.funcignore` file. |
234+
| **`--management-url`** | Sets the management URL for your cloud. Use this when running in a sovereign cloud. |
231235
| **`--no-build`** | Project isn't built during publishing. For Python, `pip install` isn't performed. |
232236
| **`--nozip`** | Turns the default `Run-From-Package` mode off. |
233237
| **`--overwrite-settings -y`** | Suppress the prompt to overwrite app settings when `--publish-local-settings -i` is used.|
234238
| **`--publish-local-settings -i`** | Publish settings in local.settings.json to Azure, prompting to overwrite if the setting already exists. If you're using a [local storage emulator](functions-develop-local.md#local-storage-emulator), first change the app setting to an [actual storage connection](functions-run-local.md#get-your-storage-connection-strings). |
235239
| **`--publish-settings-only`**, **`-o`** | Only publish settings and skip the content. Default is prompt. |
236240
| **`--slot`** | Optional name of a specific slot to which to publish. |
241+
| **`--subscription`** | Sets the default subscription to use. |
242+
237243

238244
# [v1.x](#tab/v1)
239245

@@ -252,6 +258,39 @@ Gets the connection string for the specified Azure Storage account.
252258
func azure storage fetch-connection-string <STORAGE_ACCOUNT_NAME>
253259
```
254260

261+
## func azurecontainerapps deploy
262+
263+
Deploys a containerized function app to an Azure Container Apps environment. Both the storage account used by the function app and the environment must already exist. For more information, see [Azure Container Apps hosting of Azure Functions](functions-container-apps-hosting.md).
264+
265+
```command
266+
func azurecontainerapps deploy --name <APP_NAME> --environment <ENVIRONMENT_NAME> --storage-account <STORAGE_CONNECTION> --resource-group <RESOURCE_GROUP> --image-name <IMAGE_NAME> --registry-server <REGISTRY_SERVER> --registry-username <USERNAME> --registry-password <PASSWORD>
267+
268+
```
269+
270+
The following deployment options apply:
271+
272+
| Option | Description |
273+
| ------------ | -------------------------------------- |
274+
| **`--access-token`** | Let's you use a specific access token when performing authenticated azure actions. |
275+
| **`--access-token-stdin `** | Reads a specific access token from a standard input. Use this when reading the token directly from a previous command such as [`az account get-access-token`](/cli/azure/account#az-account-get-access-token). |
276+
| **`--environment`** | The name of an existing Container Apps environment.|
277+
| **`--image-build`** | When set to `true`, skips the local Docker build. |
278+
| **`--image-name`** | The image name of an existing container in a container registry. The image name includes the tag name. |
279+
| **`--location `** | Region for the deployment. Ideally, this is the same region as the environment and storage account resources. |
280+
| **`--management-url`** | Sets the management URL for your cloud. Use this when running in sovereign cloud. |
281+
| **`--name`** | The name used for the function app deployment in the Container Apps environment. This same name is also used when managing the function app in the portal. The name should be unique in the environment. |
282+
| **`--registry`** | When set, a Docker build is run and the image is pushed to the registry set in `--registry`. You can't use `--registry` with `--image-name`. For Docker Hub, also use `--registry-username`.|
283+
| **`--registry-password`** | The password or token used to retrieve the image from a private registry.|
284+
| **`--registry-username`** | The username used to retrieve the image from a private registry.|
285+
| **`--resource-group`** | The resource group in which to create the functions-related resources.|
286+
| **`--storage-account`** | The connection string for the storage account to be used by the function app.|
287+
| **`--subscription`** | Sets the default subscription to use. |
288+
| **`--worker-runtime`** | Sets the runtime language of the function app. This parameter is only used with `--image-name` and `--image-build`, otherwise the language is determined during the local build. Supported values are: `dotnet`, `dotnetIsolated`, `node`, `python`, `powershell`, and `custom` (for customer handlers). |
289+
290+
291+
> [!IMPORTANT]
292+
> Storage connection strings and other service credentials are important secrets. Make sure to securely store any script files using `func azurecontainerapps deploy` and don't store them in any publicly accessible source control.
293+
255294
## func deploy
256295

257296
The `func deploy` command is deprecated. Instead use [`func kubernetes deploy`](#func-kubernetes-deploy).
@@ -475,7 +514,7 @@ Deploys a Functions project as a custom docker container to a Kubernetes cluster
475514
func kubernetes deploy
476515
```
477516

478-
This command builds your project as a custom container and publishes it to a Kubernetes cluster. Custom containers must have a Dockerfile. To create an app with a Dockerfile, use the `--dockerfile` option with the [`func init` command](#func-init).
517+
This command builds your project as a custom container and publishes it to a Kubernetes cluster. Custom containers must have a Dockerfile. To create an app with a Dockerfile, use the `--dockerfile` option with the [`func init`](#func-init) command.
479518

480519
The following Kubernetes deployment options are available:
481520

@@ -502,9 +541,7 @@ The following Kubernetes deployment options are available:
502541
| **`--service-type`** | Sets the type of Kubernetes Service. Supported values are: `ClusterIP`, `NodePort`, and `LoadBalancer` (default). |
503542
| **`--use-config-map`** | Use a `ConfigMap` object (v1) instead of a `Secret` object (v1) to configure [function app settings](functions-how-to-use-azure-function-app-settings.md#settings). The map name is set using `--config-map-name`.|
504543

505-
Core Tools uses the local Docker CLI to build and publish the image.
506-
507-
Make sure your Docker is already installed locally. Run the `docker login` command to connect to your account.
544+
Core Tools uses the local Docker CLI to build and publish the image. Make sure your Docker is already installed locally. Run the `docker login` command to connect to your account.
508545

509546
To learn more, see [Deploying a function app to Kubernetes](functions-kubernetes-keda.md#deploying-a-function-app-to-kubernetes).
510547

articles/azure-functions/functions-how-to-custom-container.md

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
---
22
title: Working with Azure Functions in containers
33
description: Learn how to work with function apps running in Linux containers.
4-
ms.date: 06/14/2023
4+
ms.date: 07/30/2023
55
ms.topic: how-to
66
ms.custom: build-2023
77
zone_pivot_groups: functions-container-hosting
88
---
99

1010
# Working with containers and Azure Functions
1111

12-
This article demonstrates the support that Azure Functions provides for working with function apps running in Linux containers. Choose the hosting environment for your containerized function app at the top of the article.
12+
:::zone pivot="container-apps"
13+
This article demonstrates the support that Azure Functions provides for working with containerized function apps running in an Azure Container Apps environment. Support for hosting function app containers in Container Apps is currently in preview. For more information, see [Azure Container Apps hosting of Azure Functions](functions-container-apps-hosting.md).
14+
::: zone-end
15+
:::zone pivot="azure-functions,azure-arc"
16+
This article demonstrates the support that Azure Functions provides for working with function apps running in Linux containers.
17+
::: zone-end
18+
19+
Choose the hosting environment for your containerized function app at the top of the article.
1320

1421
If you want to jump right in, the following article shows you how to create your first function running in a Linux container and deploy the image from a container registry to a supported Azure hosting service:
1522

@@ -115,13 +122,15 @@ az functionapp config container set --image <IMAGE_NAME> --registry-password <SE
115122

116123
In this example, `<IMAGE_NAME>` is the full name of the new image with version. Private registries require you to supply a username and password. Store these credentials securely.
117124

118-
:::zone pivot="azure-functions"
125+
:::zone pivot="azure-functions"
119126
You should also consider [enabling continuous deployment](#enable-continuous-deployment-to-azure).
120-
::: zone-end
121-
:::zone pivot="azure-functions,container-apps"
127+
::: zone-end
128+
:::zone pivot="azure-functions,container-apps"
122129
## Azure portal create using containers
123130

124-
When you create a function app in the [Azure portal](https://portal.azure.com), you can also create a deployment of the function app from an existing container image. The following steps create and deploy a function app from an [existing container image](#creating-your-function-app-in-a-container).
131+
When you create a function app in the [Azure portal](https://portal.azure.com), you can choose to deploy the function app from an image in a container registry. To learn how to create a containerized function app in a container registry, see[Creating your function app in a container](#creating-your-function-app-in-a-container).
132+
133+
The following steps create and deploy an existing containerized function app from a container registry.
125134

126135
1. From the Azure portal menu or the **Home** page, select **Create a resource**.
127136

@@ -133,23 +142,30 @@ When you create a function app in the [Azure portal](https://portal.azure.com),
133142
| ------------ | ---------------- | ----------- |
134143
| **Subscription** | Your subscription | The subscription in which you create your function app. |
135144
| **[Resource Group](../azure-resource-manager/management/overview.md)** | *myResourceGroup* | Name for the new resource group in which you create your function app. You should create a resource group because there are [known limitations when creating new function apps in an existing resource group](functions-scale.md#limitations-for-creating-new-function-apps-in-an-existing-resource-group).|
136-
| **Function App name** | Globally unique name | Name that identifies your new function app. Valid characters are `a-z` (case insensitive), `0-9`, and `-`. |
145+
| **Function App name** | Unique name<sup>*</sup> | Name that identifies your new function app. Valid characters are `a-z` (case insensitive), `0-9`, and `-`. |
137146
| **Do you want to deploy code or container image?**| Container image | Deploy a containerized function app from a registry. To create a function app in registry, see [Create a function app in a local container](functions-create-container-registry.md). |
138-
|**Region**| Preferred region | Select a [region](https://azure.microsoft.com/regions/) that's near you or near other services that your functions can access. |
139-
::: zone-end
140-
:::zone pivot="azure-functions"
147+
|**Region**| Preferred region | Select a [region](https://azure.microsoft.com/regions/) that's near you or near other services that your functions can access. |
148+
149+
::: zone-end
150+
:::zone pivot="azure-functions"
151+
<sup>*</sup>App name must be globally unique amongst all Azure Functions hosted apps.
152+
141153
4. In **[Hosting options and plans](functions-scale.md)**, choose **Functions Premium**.
142154

143-
:::image type="content" source="media/functions-how-to-custom-container/function-app-create-container-functions-premium.png" alt-text="Screenshot of the Basics tab in the Azure portal when creating a function app for hosting a container in a Functions Premium plan.":::
155+
:::image type="content" source="media/functions-how-to-custom-container/function-app-create-container-functions-premium.png" alt-text="Screenshot of the Basics tab in the Azure portal when creating a function app for hosting a container in a Functions Premium plan.":::
144156

145157
This creates a function app hosted by Azure Functions in the [Premium plan](functions-premium-plan.md), which supports dynamic scaling. You can also choose to run in an **App Service plan**, but in this kind of dedicated plan you must manage the [scaling of your function app](functions-scale.md).
146-
::: zone-end
147-
:::zone pivot="container-apps"
158+
::: zone-end
159+
:::zone pivot="container-apps"
160+
<sup>*</sup>App name must be unique within the Azure Container Apps environment. Not all regions are supported in the preview. For more information, see [Considerations for Container Apps hosting](functions-container-apps-hosting.md#considerations-for-container-apps-hosting).
161+
148162
4. In **[Hosting options and plans](functions-scale.md)**, choose **Azure Container Apps Environment plan**.
149163

150164
:::image type="content" source="media/functions-how-to-custom-container/function-app-create-container-apps-hosting.png" alt-text="Portal create Basics tab for a containerized function app hosted in Azure Container Apps.":::
151165

152-
This creates a new **Azure Container Apps Environment** resource to host your function app container. By default, the environment is created in a Consumption plan without zone redundancy, to minimize costs. You can also choose an existing Container Apps environment. For more information, see [Azure Container Apps hosting of Azure Functions](functions-container-apps-hosting.md).
166+
This creates a new **Azure Container Apps Environment** resource to host your function app container. For more information, see [Azure Container Apps hosting of Azure Functions](functions-container-apps-hosting.md).
167+
168+
By default, the environment is created in a Consumption plan without zone redundancy, to minimize costs. You can also choose an existing Container Apps environment. To learn about environments, see [Azure Container Apps environments](../container-apps/environment.md).
153169
::: zone-end
154170
:::zone pivot="azure-functions,container-apps"
155171
5. Accept the default options of creating a new storage account on the **Storage** tab and a new Application Insight instance on the **Monitoring** tab. You can also choose to use an existing storage account or Application Insights instance.

0 commit comments

Comments
 (0)