You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/container-apps/functions-container-apps.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
---
2
-
title: Create your Azure Functions on Azure Container Apps
3
-
description: Get started with Azure Functions on Azure Container Apps by deploying your function app within a Linux image in a container registry.
2
+
title: Create your Azure Functions app through custom containers on Azure Container Apps
3
+
description: Get started with Azure Functions on Azure Container Apps by deploying your function app within a custom Linux image in a container registry.
# Create your Azure Functions on Azure Container Apps
13
+
# Create your Azure Functions app custom containers on Azure Container Apps
14
14
15
15
In this article, you create a function app running in a Linux container and deploy it to an Azure Container Apps environment from a container registry. By deploying to Container Apps, you're able to integrate your function apps into cloud-native microservices. For more information, see [Azure Container Apps hosting of Azure Functions](../azure-functions/functions-container-apps-hosting.md).
16
16
@@ -77,9 +77,9 @@ Use these commands to create your required Azure resources:
The `az storage account create` command creates the storage account that can only be accessed by using Microsoft Entra-authenticated identities that have been granted permissions to specific resources.
80
+
The `az storage account create` command creates the storage account that is only accessible by using Microsoft Entra-authenticated identities that are granted permissions to specific resources.
81
81
82
-
In the previous example, replace `<STORAGE_NAME>` with a name that is appropriate to you and unique in Azure Storage. Storage names must contain 3 to 24 characters numbers and lowercase letters only. `Standard_LRS` specifies a general-purpose account [supported by Functions](../azure-functions/storage-considerations.md#storage-account-requirements).
82
+
In the previous example, replace `<STORAGE_NAME>` with a name that's appropriate to you and unique in Azure Storage. Storage names must contain 3 to 24 characters numbers and lowercase letters only. `Standard_LRS` specifies a general-purpose account [supported by Functions](../azure-functions/storage-considerations.md#storage-account-requirements).
83
83
84
84
1. Create a managed identity and use the returned `principalId` to grant it both access to your storage account and pull permissions in your registry instance.
85
85
@@ -91,7 +91,7 @@ Use these commands to create your required Azure resources:
91
91
az role assignment create --assignee-object-id $principalId --assignee-principal-type ServicePrincipal --role "Storage Blob Data Owner" --scope $storageId
92
92
```
93
93
94
-
The `az identity create` command creates a user-assigned managed identity and the `az role assignment create`commands adds your identity to the required roles. Replace `<REGISTRY_NAME>`, `<USER_IDENTITY_NAME>`, and `<STORAGE_NAME>` with the name your existing container registry, the name for your managed identity, and the storage account name, respectively. The managed identity can now be used by an app to access both the storage account and Azure Container Registry without using shared secrets.
94
+
The `az identity create` command creates a user-assigned managed identity and the `az role assignment create`commands adds your identity to the required roles. Replace `<REGISTRY_NAME>`, `<USER_IDENTITY_NAME>`, and `<STORAGE_NAME>` with the name your existing container registry, the name for your managed identity, and the storage account name, respectively. The managed identity is now available to the app to access both the storage account and Azure Container Registry without using shared secrets.
95
95
96
96
## Create and configure a function app on Azure with the image
In the `az containerapp create --kind=functionapp`command, the `--environment` parameter specifies the Container Apps environment and the `--image` parameter specifies the image to use for the function app. In this example, replace `<STORAGE_NAME>` with the name you used in the previous section for the storage account. Also, replace `<APP_NAME>` with a globally unique name appropriate to you and `<DOCKER_ID>` with your public Docker Hub account ID.
138
138
139
-
If you're using a private registry, you need to include the fully qualified domain name of your registry instead of just the Docker ID for `<DOCKER_ID>`, along with the `--registry-username` and `--registry-password` credential required to access the registry.
139
+
If you're using a private registry, you need to include the fully qualified domain name of your registry instead of just the Docker ID for `<DOCKER_ID>`, along with the `--registry-username` and `--registry-password` credential required to access the registry.
140
140
141
141
---
142
142
@@ -170,21 +170,23 @@ At this point, your functions are running in a Container Apps environment, with
170
170
171
171
172
172
## Verify your functions on Azure
173
-
With the image deployed to your function app in Azure, you can now invoke the function through HTTP requests.Get detailed information about a specific function:
173
+
With the image deployed to your function app in Azure, you can now invoke the function through HTTP requests.Get detailed information about a specific function:
174
174
175
175
```azurecli
176
176
az containerapp function show \
177
177
--resource-group AzureFunctionsContainers-rg \
178
178
--name <APP_NAME> \
179
179
--function-name HttpExample
180
180
```
181
-
Replace <APP_NAME> with the name of your function app.Use the URL you just obtained to call the HttpExample function endpoint, appending the query string ?name=Functions.
181
+
182
+
Replace <APP_NAME> with the name of your function app. Use the URL you just obtained to call the HttpExample function endpoint, appending the query string `?name=Functions`.
182
183
183
184
The request URL should look something like this:
184
185
185
186
::: zone pivot="programming-language-java,programming-language-javascript,programming-language-typescript,programming-language-powershell,programming-language-python"
title: Manage your Azure Functions in Container Apps
3
+
description: Learn to manage functions in Container Apps
4
+
services: container-apps
5
+
author: deepganguly
6
+
ms.service: azure-container-apps
7
+
ms.topic: how-to
8
+
ms.date: 01/12/2026
9
+
ms.author: deepganguly
10
+
---
11
+
12
+
# Manage Azure Functions in Azure Container Apps
13
+
14
+
You can manage your deployed functions within Azure Container Apps by using the Azure CLI. The following commands help you list, inspect, and interact with the functions running in your containerized environment.
15
+
16
+
> [!NOTE]
17
+
> When dealing with multirevision scenarios, add the `--revision <REVISION_NAME>` parameter to your command to target a specific revision.
18
+
19
+
## List functions
20
+
21
+
View all functions deployed in your container app:
22
+
23
+
```azurecli
24
+
# List all functions
25
+
az containerapp function list \
26
+
--resource-group $RESOURCE_GROUP \
27
+
--name $CONTAINERAPP_NAME
28
+
```
29
+
30
+
## Show function details
31
+
32
+
Get detailed information about a specific function:
33
+
34
+
```azurecli
35
+
az containerapp function show \
36
+
--resource-group $RESOURCE_GROUP \
37
+
--name $CONTAINERAPP_NAME \
38
+
--function-name <FUNCTIONS_APP_NAME>
39
+
```
40
+
41
+
## Monitor function invocations
42
+
43
+
Monitoring your function app is essential for understanding its performance and diagnosing problems. The following commands show you how to retrieve function URLs, trigger invocations, and view detailed telemetry and invocation summaries by using the Azure CLI. Before calling the traces, invoke the function a few times by using `curl -X POST "fqdn/api/HttpExample"`.
44
+
45
+
1. To view invocation traces, get detailed traces of function invocations:
46
+
47
+
```azurecli
48
+
az containerapp function invocations traces \
49
+
--name $CONTAINERAPP_NAME \
50
+
--resource-group $RESOURCE_GROUP \
51
+
--function-name <FUNCTIONS_APP_NAME> \
52
+
--timespan 5h \
53
+
--limit 3
54
+
```
55
+
56
+
1. View an invocation summary to review successful and failed invocations.
57
+
58
+
```azurecli
59
+
az containerapp function invocations summary \
60
+
--name $CONTAINERAPP_NAME \
61
+
--resource-group $RESOURCE_GROUP \
62
+
--function-name <FUNCTIONS_APP_NAME> \
63
+
--timespan 5h
64
+
```
65
+
66
+
## Manage function keys
67
+
68
+
Azure Functions uses [keys for authentication and authorization](/azure/azure-functions/function-keys-how-to). You can manage the following different types of keys:
69
+
70
+
- **Host keys**: Access any function in the app
71
+
- **Master keys**: Provide administrative access
72
+
- **System keys**: Used by Azure services
73
+
- **Function keys**: Access specific functions
74
+
75
+
The following commands show you how to manage keys for the host. To run the same command for a specific Functions app, add the `--function-name <FUNCTIONS_APP_NAME>` parameter to your command.
76
+
77
+
### List keys
78
+
79
+
Use the following commands to list host-level and function-specific keys for your Azure Functions running in Container Apps.
80
+
81
+
> [!NOTE]
82
+
> Keep at least one replica running for the following keys management commands to work.
83
+
84
+
```azurecli
85
+
az containerapp function keys list \
86
+
--resource-group $RESOURCE_GROUP \
87
+
--name $CONTAINERAPP_NAME \
88
+
--key-type hostKey
89
+
```
90
+
91
+
### Show a specific key
92
+
93
+
Show the value of a specific host-level key for your function app by using the following command:
94
+
95
+
```azurecli
96
+
az containerapp function keys show \
97
+
--resource-group $RESOURCE_GROUP \
98
+
--name $CONTAINERAPP_NAME \
99
+
--key-name <KEY_NAME> \
100
+
--key-type hostKey
101
+
```
102
+
103
+
### Set a key
104
+
105
+
Set a specific host-level key for your function app by using the following command:
106
+
107
+
```azurecli
108
+
az containerapp function keys set \
109
+
--resource-group $RESOURCE_GROUP \
110
+
--name $CONTAINERAPP_NAME \
111
+
--key-name <KEY_NAME> \
112
+
--key-value <KEY_VALUE> \
113
+
--key-type hostKey
114
+
```
115
+
116
+
### Key management with Azure Key Vault
117
+
118
+
When you use Azure Key Vault to store secrets for Azure Functions on Container Apps, key generation works differently than in traditional Functions hosting.
119
+
120
+
By default:
121
+
122
+
- The Functions host doesn't automatically create keys in Key Vault when it starts.
123
+
124
+
- The Functions host retrieves and uses keys if they already exist in Key Vault.
125
+
126
+
- The Functions host starts successfully even without keys, and the key synchronization completes normally.
127
+
128
+
As a result, your application runs correctly, but host-level keys don't appear in Key Vault unless you create them manually.
129
+
130
+
#### Generate keys manually
131
+
132
+
To trigger key creation in Azure Key Vault, call the Functions management endpoint by using the following CLI command.
133
+
134
+
```azurecli
135
+
az containerapp function keys list \
136
+
-n <CONTAINER_APP_NAME> \
137
+
-g <RESOURCE_GROUP> \
138
+
--key-type hostKey
139
+
```
140
+
141
+
## Related content
142
+
143
+
-[Azure Functions on Azure Container Apps overview](../../articles/container-apps/functions-overview.md)
0 commit comments