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
This article describes how to deploy your function app project files to Azure from a .zip (compressed) file. You learn how to do a push deployment, both by using Azure CLI and by using the REST APIs. [Azure Functions Core Tools](functions-run-local.md) also uses these deployment APIs when publishing a local project to Azure.
12
+
This article describes how to deploy your function app project files to Azure from a .zip (compressed) file. You learn how to do a push deployment, both by using Azure CLI and by using the REST APIs. [Azure Functions Core Tools](functions-run-local.md) also uses these deployment APIs when publishing a local project to Azure.
13
13
14
-
Zip deployment is also an easy way to [run your functions from a package file in Azure](run-functions-from-deployment-package.md). It is the default deployment technology in the [Consumption](./consumption-plan.md), [Elastic Premium](./functions-premium-plan.md), and [Dedicated (App Service)](./dedicated-plan.md) hosting plans. The [Flex Consumption](./flex-consumption-plan.md) plan does not support zip deployment.
14
+
Zip deployment is also an easy way to [run your functions from a package file in Azure](run-functions-from-deployment-package.md). It's the default deployment technology in the [Consumption](./consumption-plan.md), [Elastic Premium](./functions-premium-plan.md), and [Dedicated (App Service)](./dedicated-plan.md) hosting plans. The [Flex Consumption](./flex-consumption-plan.md) plan doesn't support zip deployment.
15
15
16
16
Azure Functions has the full range of continuous deployment and integration options that are provided by Azure App Service. For more information, see [Continuous deployment for Azure Functions](functions-continuous-deployment.md).
17
17
18
18
To speed up development, you might find it easier to deploy your function app project files directly from a .zip file. The .zip deployment API takes the contents of a .zip file and extracts the contents into the `wwwroot` folder of your function app. This .zip file deployment uses the same Kudu service that powers continuous integration-based deployments, including:
19
19
20
-
+ Deletion of files that were left over from earlier deployments.
21
-
+ Deployment customization, including running deployment scripts.
22
-
+ Deployment logs.
23
-
+ Syncing function triggers in a [Consumption plan](functions-scale.md) function app.
20
+
- Deletion of files that were left over from earlier deployments.
21
+
- Deployment customization, including running deployment scripts.
22
+
- Deployment logs.
23
+
- Syncing function triggers in a [Consumption plan](functions-scale.md) function app.
24
24
25
25
For more information, see the [.zip deployment reference](https://github.com/projectkudu/kudu/wiki/Deploying-from-a-zip-file).
26
26
@@ -31,11 +31,11 @@ For more information, see the [.zip deployment reference](https://github.com/pro
A zip deployment process extracts the zip archive's files and folders in the `wwwroot` directory. If you include the parent directory when creating the archive, the system will not find the files it expects to see in `wwwroot`.
34
+
A zip deployment process extracts the zip archive's files and folders in the `wwwroot` directory. If you include the parent directory when creating the archive, the system won't find the files it expects to see in `wwwroot`.
35
35
36
36
## <aname="cli"></a>Deploy by using Azure CLI
37
37
38
-
You can use Azure CLI to trigger a push deployment. Push deploy a .zip file to your function app by using the [az functionapp deployment source config-zip](/cli/azure/functionapp/deployment/source#az-functionapp-deployment-source-config-zip) command. To use this command, you must use Azure CLI version 2.0.21 or later. To see what Azure CLI version you are using, use the `az --version` command.
38
+
You can use Azure CLI to trigger a push deployment. Push deploy a .zip file to your function app by using the [az functionapp deployment source config-zip](/cli/azure/functionapp/deployment/source#az-functionapp-deployment-source-config-zip) command. To use this command, you must use Azure CLI version 2.0.21 or later. To see what Azure CLI version you're using, use the `az --version` command.
39
39
40
40
In the following command, replace the `<zip_file_path>` placeholder with the path to the location of your .zip file. Also, replace `<app_name>` with the unique name of your function app and replace `<resource_group>` with the name of your resource group.
41
41
@@ -107,7 +107,7 @@ For the initial deployment, you would deploy directly to the production slot. Fo
107
107
108
108
## Run functions from the deployment package
109
109
110
-
You can also choose to run your functions directly from the deployment package file. This method skips the deployment step of copying files from the package to the `wwwroot` directory of your function app. Instead, the package file is mounted by the Functions runtime, and the contents of the `wwwroot` directory become read-only.
110
+
You can also choose to run your functions directly from the deployment package file. This method skips the deployment step of copying files from the package to the `wwwroot` directory of your function app. Instead, the Functions runtime mounts the package file, and the contents of the `wwwroot` directory become read-only.
111
111
112
112
Zip deployment integrates with this feature, which you can enable by setting the function app setting `WEBSITE_RUN_FROM_PACKAGE` to a value of `1`. For more information, see [Run your functions from a deployment package file](run-functions-from-deployment-package.md).
113
113
@@ -117,25 +117,25 @@ Zip deployment integrates with this feature, which you can enable by setting the
117
117
118
118
If you created your functions by using the editor in the Azure portal, you can download your existing function app project as a .zip file in one of these ways:
119
119
120
-
+**From the Azure portal:**
120
+
-**From the Azure portal:**
121
121
122
122
1. Sign in to the [Azure portal](https://portal.azure.com), and then go to your function app.
123
123
124
124
2. On the **Overview** tab, select **Download app content**. Select your download options, and then select **Download**.
125
125
126
-

126
+
:::image type="content" source="./media/deployment-zip-push/download-project.png" alt-text="Screenshot shows the Azure portal page to download the function app project.":::
127
127
128
128
The downloaded .zip file is in the correct format to be republished to your function app by using .zip push deployment. The portal download can also add the files needed to open your function app directly in Visual Studio.
129
129
130
-
+**Using REST APIs:**
130
+
-**Using REST APIs:**
131
131
132
132
Use the following deployment GET API to download the files from your `<function_app>` project:
Including `/site/wwwroot/` makes sure your zip file includes only the function app project files and not the entire site. If you are not already signed in to Azure, you will be asked to do so.
138
+
Including `/site/wwwroot/` makes sure your zip file includes only the function app project files and not the entire site. If you aren't already signed in to Azure, you are asked to do so.
139
139
140
140
You can also download a .zip file from a GitHub repository. When you download a GitHub repository as a .zip file, GitHub adds an extra folder level for the branch. This extra folder level means that you can't deploy the .zip file directly as you downloaded it from GitHub. If you're using a GitHub repository to maintain your function app, you should use [continuous integration](functions-continuous-deployment.md) to deploy your app.
While deploying synchronously you may receive errors related to connection timeouts. Add `?isAsync=true` to the URL to deploy asynchronously. You will receive a response as soon as the zip file is uploaded with a `Location` header pointing to the pollable deployment status URL. When polling the URL provided in the `Location` header, you will receive a HTTP 202 (Accepted) response while the process is ongoing and a HTTP 200 (OK) response once the archive has been expanded and the deployment has completed successfully.
30
+
While deploying synchronously, you might receive errors related to connection timeouts. Add `?isAsync=true` to the URL to deploy asynchronously. You receive a response as soon as the zip file is uploaded with a `Location` header pointing to the pollable deployment status URL. When polling the URL provided in the `Location` header, you receive an HTTP 202 (Accepted) response while the process is ongoing and an HTTP 200 (OK) response once the archive has been expanded and the deployment completes successfully.
31
31
32
32
<aname='azure-ad-authentication'></a>
33
33
34
34
#### Microsoft Entra authentication
35
35
36
-
An alternative to using HTTP BASIC authentication for the zip deployment is to use a Microsoft Entra identity. Microsoft Entra identity may be needed if [HTTP BASIC authentication is disabled for the SCM site](../articles/app-service/deploy-configure-credentials.md#disable-basic-authentication).
36
+
An alternative to using HTTP BASIC authentication for the zip deployment is to use a Microsoft Entra identity. Microsoft Entra identity might be needed if [HTTP BASIC authentication is disabled for the SCM site](../articles/app-service/deploy-configure-credentials.md#disable-basic-authentication).
37
37
38
-
A valid Microsoft Entra access token for the user or service principal performing the deployment will be required. An access token can be retrieved using the Azure CLI's `az account get-access-token` command. The access token will be used in the Authentication header of the HTTP POST request.
38
+
A valid Microsoft Entra access token for the user or service principal performing the deployment is required. An access token can be retrieved using the Azure CLI's `az account get-access-token` command. The access token is used in the Authentication header of the HTTP POST request.
Copy file name to clipboardExpand all lines: includes/functions-deployment-zip-structure.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,9 @@ ms.date: 07/16/2024
6
6
ms.author: glenga
7
7
---
8
8
9
-
The zip archive you deploy must contain all of the files needed to run your function app. You can manually create a zip archive from the contents of a Functions project folder using built-in .zip compression functionality or third-party tools.
9
+
The zip archive you deploy must contain all of the files needed to run your function app. You can manually create a zip archive from the contents of a Functions project folder using built-in .zip compression functionality or non-Microsoft tools.
10
10
11
-
The archive must include the [host.json](../articles/azure-functions/functions-host-json.md) file at the root of the extracted folder. The selected language stack for the function app creates additional requirements:
11
+
The archive must include the [host.json](../articles/azure-functions/functions-host-json.md) file at the root of the extracted folder. The selected language stack for the function app creates other requirements:
0 commit comments