Skip to content

Commit 8f33832

Browse files
committed
updated main deployment doc to be Flex aware
1 parent 188f281 commit 8f33832

File tree

1 file changed

+54
-28
lines changed

1 file changed

+54
-28
lines changed

articles/azure-functions/functions-deployment-technologies.md

Lines changed: 54 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Deployment technologies in Azure Functions
33
description: Learn the different ways you can deploy code to Azure Functions.
44
ms.custom: vs-azure, vscode-azure-extension-update-not-needed, build-2023, build-2024
55
ms.topic: conceptual
6-
ms.date: 03/29/2024
6+
ms.date: 09/27/2024
77
---
88

99
# Deployment technologies in Azure Functions
@@ -27,23 +27,26 @@ Specific deployments should use the best technology based on the specific scenar
2727
## Deployment technology availability
2828

2929
The deployment method also depends on the hosting plan and operating system on which you run your function app.
30-
Currently, Functions offers three hosting plans:
3130

31+
Currently, Functions offers four hosting plans:
32+
33+
+ [Flex Consumption](flex-consumption-plan.md)
3234
+ [Consumption](consumption-plan.md)
3335
+ [Premium](functions-premium-plan.md)
3436
+ [Dedicated (App Service)](dedicated-plan.md)
3537

3638
Each plan has different behaviors. Not all deployment technologies are available for each hosting plan and operating system. This chart provides information on the supported deployment technologies:
3739

38-
| Deployment technology | Windows Consumption | Windows Premium | Windows Dedicated | Linux Consumption | Linux Premium | Linux Dedicated |
39-
|-----------------------|:-------------------:|:-------------------------:|:------------------:|:---------------------------:|:-------------:|:---------------:|
40-
| [External package URL](#external-package-url)<sup>1</sup> |||||||
41-
| [Zip deploy](#zip-deploy) |||||||
42-
| [Docker container](#docker-container) | | | | |||
43-
| [Source control](#source-control) |||| |||
44-
| [Local Git](#local-git)<sup>1</sup> |||| |||
45-
| [FTPS](#ftps)<sup>1</sup> |||| |||
46-
| [In-portal editing](#portal-editing)<sup>2</sup> |||||||
40+
| Deployment technology | Flex Consumption| Windows Consumption | Windows Premium | Windows Dedicated | Linux Consumption | Linux Premium | Linux Dedicated |
41+
|-----------------------|:-------------------:|:-------------------:|:-------------------------:|:------------------:|:---------------------------:|:-------------:|:---------------:|
42+
| [OneDeploy](#one-deploy) || | | | | | |
43+
| [Zip deploy](#zip-deploy) | |||||||
44+
| [External package URL](#external-package-url)<sup>1</sup> | |||||||
45+
| [Docker container](#docker-container) | | | | | |||
46+
| [Source control](#source-control) | |||| |||
47+
| [Local Git](#local-git)<sup>1</sup> | |||| |||
48+
| [FTPS](#ftps)<sup>1</sup> | |||| |||
49+
| [In-portal editing](#portal-editing)<sup>2</sup> | |||||||
4750

4851
<sup>1</sup> Deployment technologies that require you to [manually sync triggers](#trigger-syncing) aren't recommended.
4952
<sup>2</sup> In-portal editing is disabled when code is deployed to your function app from outside the portal. For more information, including language support details for in-portal editing, see [Language support details](supported-languages.md#language-support-details).
@@ -66,20 +69,28 @@ You can sync triggers in one of three ways:
6669

6770
+ Restart your function app in the Azure portal.
6871
+ Send an HTTP POST request to `https://{functionappname}.azurewebsites.net/admin/host/synctriggers?code=<API_KEY>` using the [master key](function-keys-how-to.md).
69-
+ Send an HTTP POST request to `https://management.azure.com/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP_NAME>/providers/Microsoft.Web/sites/<FUNCTION_APP_NAME>/syncfunctiontriggers?api-version=2016-08-01`. Replace the placeholders with your subscription ID, resource group name, and the name of your function app. This request requires an [access token](/rest/api/azure/#acquire-an-access-token) in the [`Authorization` request header](/rest/api/azure/#request-header).
72+
+ Send an HTTP POST request to `https://management.azure.com/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP_NAME>/providers/Microsoft.Web/sites/<FUNCTION_APP_NAME>/syncfunctiontriggers?api-version=2016-08-01`. Replace the placeholders with your subscription ID, resource group name, and the name of your function app. This request requires an [access token](/rest/api/azure/#acquire-an-access-token) in the [`Authorization` request header](/rest/api/azure/#request-header).
7073

74+
The Azure CLI can be used to perform the HTTP POST requests. For example:
75+
```azurecli
76+
az rest --method post --url https://management.azure.com/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.Web/sites/<APP_NAME>/syncfunctiontriggers?api-version=2016-08-01
77+
```
7178

7279
When you deploy an updated version of the deployment package and maintain the same external package URL, you need to manually restart your function app. This indicates to the host that it should synchronize and redeploy your updates from the same package URL.
7380
The Functions host also performs a background trigger sync after the application has started. However, for the Consumption and Elastic Premium hosting plans you should also [manually sync triggers](#trigger-syncing) in these scenarios:
7481

7582
+ Deployments using an external package URL with either ARM Templates or Terraform.
7683
+ When updating the deployment package at the same external package URL.
7784

85+
### Remote build
7886

87+
If you do not wish to build your code locally before deployment, you can request Azure Functions to perform a remote build. A remote build is recommended under these scenarios:
7988

80-
### Remote build
89+
+ You're developing functions for a Linux-based function app from a Windows machine. This is commonly the case for Python app development.
90+
+ Your project has dependencies on a [custom package index](functions-reference-python.md#remote-build-with-extra-index-url).
91+
+ You want to reduce the size of your deployment package.
8192

82-
Azure Functions can automatically perform builds on the code it receives after zip deployments. These builds differ depending on whether your app is running on Windows or Linux.
93+
How to convey your intention for a remote build depends on whether your app in running on Windows or Linux.
8394

8495
#### [Windows](#tab/windows)
8596

@@ -89,7 +100,7 @@ When an app is deployed to Windows, language-specific commands, like `dotnet res
89100

90101
#### [Linux](#tab/linux)
91102

92-
To enable remote build on Linux, you must set these application settings:
103+
To enable remote build on Linux Consumption, Elastic Premium, and App Service plans, you must set these application settings:
93104

94105
+ [`ENABLE_ORYX_BUILD=true`](functions-app-settings.md#enable_oryx_build)
95106
+ [`SCM_DO_BUILD_DURING_DEPLOYMENT=true`](functions-app-settings.md#scm_do_build_during_deployment)
@@ -98,48 +109,63 @@ By default, both [Azure Functions Core Tools](functions-run-local.md) and the [A
98109

99110
When apps are built remotely on Linux, they [run from the deployment package](run-functions-from-deployment-package.md).
100111

112+
To enable remote build on the Flex Consumption plan, you do not need to set any application settings. Rather, you pass a remote build parameter when deploying. How this is done depends on the deployment tool you are using. For Core Tools and Visual Studio Code, a remote build is requested whenever you deploy to a Python app.
113+
101114
---
102115

103116
The following considerations apply when using remote builds during deployment:
104117

105118
+ Remote builds are supported for function apps running on Linux in the Consumption plan. However, deployment options are limited for these apps because they don't have an `scm` (Kudu) site.
106-
+ Function apps running on Linux a [Premium plan](functions-premium-plan.md) or in a [Dedicated (App Service) plan](dedicated-plan.md) do have an `scm` (Kudu) site, but it's limited compared to Windows.
119+
+ Function apps running on Linux in a [Premium plan](functions-premium-plan.md) or in a [Dedicated (App Service) plan](dedicated-plan.md) do have an `scm` (Kudu) site, but it's limited compared to Windows.
107120
+ Remote builds aren't performed when an app is using [run-from-package](run-functions-from-deployment-package.md). To learn how to use remote build in these cases, see [Zip deploy](#zip-deploy).
108121
+ You may have issues with remote build when your app was created before the feature was made available (August 1, 2019). For older apps, either create a new function app or run `az functionapp update --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME>` to update your function app. This command might take two tries to succeed.
109122

110123
### App content storage
111124

112-
Several deployment methods store the deployed or built application payload on the storage account associated with the function app. Functions tries to use the Azure Files content share when configured, but some methods instead store the payload in the blob storage instance associated with the `AzureWebJobsStorage` connection. See the details in the _Where app content is stored_ paragraphs of each deployment technology covered in the next section.
125+
Several deployment methods store the deployed or built app content on the storage account associated with the function app. Functions tries to use the Azure Files content share when configured, but some methods instead store the payload in the blob storage instance associated with the `AzureWebJobsStorage` connection. See the details in the _Where app content is stored_ paragraphs of each deployment technology covered in the next section.
113126

114127
[!INCLUDE [functions-storage-access-note](../../includes/functions-storage-access-note.md)]
115128

116129
## Deployment technology details
117130

118131
The following deployment methods are available in Azure Functions.
119132

120-
### External package URL
121-
122-
You can use an external package URL to reference a remote package (.zip) file that contains your function app. The file is downloaded from the provided URL, and the app runs in [Run From Package](run-functions-from-deployment-package.md) mode.
133+
### One deploy
134+
One deploy is the only deployment technology supported for apps on the Flex Consumption plan. The end result a ready-to-run .zip package that your function app runs on.
123135

124-
>__How to use it:__ Add [`WEBSITE_RUN_FROM_PACKAGE`](functions-app-settings.md#website_run_from_package) to your application settings. The value of this setting should be a URL (the location of the specific package file you want to run). You can add settings either [in the portal](functions-how-to-use-azure-function-app-settings.md#settings) or [by using the Azure CLI](/cli/azure/functionapp/config/appsettings#az-functionapp-config-appsettings-set).
136+
>__How to use it:__ Deploy with the [Visual Studio Code](functions-develop-vs-code.md#publish-to-azure) publish feature, or from the command line using [Azure Functions Core Tools](functions-run-local.md#project-file-deployment) or [Azure CLI](https://learn.microsoft.com/cli/azure/functionapp/deployment/source?view=azure-cli-latest#az-functionapp-deployment-source-config-zip). Our [Azure Dev Ops Task](functions-how-to-azure-devops.md#deploy-your-app-1) and [GitHub Action](functions-how-to-github-actions.md) similarly leverage one deploy when they detect that a Flex Consumption app is being deployed to.
125137
>
126-
>If you use Azure Blob storage, use a private container with a [shared access signature (SAS)](../vs-azure-tools-storage-manage-with-storage-explorer.md#generate-a-sas-in-storage-explorer) to give Functions access to the package. Any time the application restarts, it fetches a copy of the content. Your reference must be valid for the lifetime of the application.
138+
> When you create a Flex Consumption app, you will need to specify a deployment storage (blob) container as well as an authentication method to it. By default the same storage account as the `AzureWebJobsStorage` connection is used, with a connection string as the authentication method. Thus, your [deployment settings](flex-consumption-how-to.md#configure-deployment-settings) are configured during app create time without any need of application settings.
127139
128-
>__When to use it:__ External package URL is the only supported deployment method for Azure Functions running on Linux in the Consumption plan, if the user doesn't want a [remote build](#remote-build) to occur. Whenever you deploy the package file that a function app references, you must [manually sync triggers](#trigger-syncing), including the initial deployment. When you change the contents of the package file and not the URL itself, you must also restart your function app to sync triggers.
140+
>__When to use it:__ One deploy is the only deployment technology available for function apps running on the Flex Consumption plan.
129141
130-
>__Where app content is stored:__ App content is stored at the URL specified. This could be on Azure Blobs, possibly in the storage account specified by the `AzureWebJobsStorage` connection. Some client tools may default to deploying to a blob in this account. For example, for Linux Consumption apps, the Azure CLI will attempt to deploy through a package stored in a blob on the account specified by `AzureWebJobsStorage`.
142+
>__Where app content is stored:__ When you create a Flex Consumption function app, you specify a deployment storage container. This is a blob container where the platform will upload the app content you deployed. To change the location, you can visit the Deployment Settings blade in the Azure portal or use the [Azure CLI](flex-consumption-how-to.md#configure-deployment-settings).
131143
132144
### Zip deploy
133145

134-
Use zip deploy to push a .zip file that contains your function app to Azure. Optionally, you can set your app to start [running from package](run-functions-from-deployment-package.md), or specify that a [remote build](#remote-build) occurs.
146+
Zip deploy is the default and recommended deployment technology for function apps on the Consumption, Elastic Premium, and App Service (Dedicated) plans. The end result a ready-to-run .zip package that your function app runs on. It differs from [external package URL](#external-package-url) in that our platform is responsible for remote building and storing your app content.
135147

136-
>__How to use it:__ Deploy by using your favorite client tool: [Visual Studio Code](functions-develop-vs-code.md#publish-to-azure), [Visual Studio](functions-develop-vs.md#publish-to-azure), or from the command line using the [Azure Functions Core Tools](functions-run-local.md#project-file-deployment). By default, these tools use zip deployment and [run from package](run-functions-from-deployment-package.md). Core Tools and the Visual Studio Code extension both enable [remote build](#remote-build) when deploying to Linux. To manually deploy a .zip file to your function app, follow the instructions in [Deploy from a .zip file or URL](https://github.com/projectkudu/kudu/wiki/Deploying-from-a-zip-file-or-url).
148+
>__How to use it:__ Deploy by using your favorite client tool: [Visual Studio Code](functions-develop-vs-code.md#publish-to-azure), [Visual Studio](functions-develop-vs.md#publish-to-azure), or from the command line using [Azure Functions Core Tools](functions-run-local.md#project-file-deployment) or [Azure CLI](https://learn.microsoft.com/cli/azure/functionapp/deployment/source?view=azure-cli-latest#az-functionapp-deployment-source-config-zip). Our [Azure Dev Ops Task](functions-how-to-azure-devops.md#deploy-your-app-1) and [GitHub Action](functions-how-to-github-actions.md) similarly leverage zip deploy.
137149
138150
>When you deploy by using zip deploy, you can set your app to [run from package](run-functions-from-deployment-package.md). To run from package, set the [`WEBSITE_RUN_FROM_PACKAGE`](functions-app-settings.md#website_run_from_package) application setting value to `1`. We recommend zip deployment. It yields faster loading times for your applications, and it's the default for VS Code, Visual Studio, and the Azure CLI.
139151
140-
>__When to use it:__ Zip deploy is the recommended deployment technology for Azure Functions.
152+
>__When to use it:__ Zip deploy is the default and recommended deployment technology for function apps on the Windows Consumption, Windows and Linux Elastic Premium, and Windows and Linux App Service (Dedicated) plans.
153+
154+
>__Where app content is stored:__ App content from a zip deploy by default is stored on the file system, which may be backed by Azure Files from the storage account specified when the function app was created. In Linux Consumption, the app content is instead persisted on a blob in the storage account specified by the `AzureWebJobsStorage` app setting, and the app setting `WEBSITE_RUN_FROM_PACKAGE` will take on the value of the blob URL.
155+
156+
### External package URL
157+
158+
External package URL is an option if you want to manually control how deployments are performed. You take responsibility for uploading a ready-to-run .zip package containing your built app content to blob storage and referencing this external URL as an application setting on your function app. Whenever your app restarts, it fetches the package, mounts it, and runs in [Run From Package](run-functions-from-deployment-package.md) mode.
159+
160+
>__How to use it:__ Add [`WEBSITE_RUN_FROM_PACKAGE`](functions-app-settings.md#website_run_from_package) to your application settings. The value of this setting should be a blob URL pointing to the location of the specific package you want your app to run. You can add settings either [in the portal](functions-how-to-use-azure-function-app-settings.md#settings) or [by using the Azure CLI](/cli/azure/functionapp/config/appsettings#az-functionapp-config-appsettings-set).
161+
>
162+
>If you use Azure Blob Storage, you can choose to have your function app access the blob with a [shared access signature (SAS)](../vs-azure-tools-storage-manage-with-storage-explorer.md#generate-a-sas-in-storage-explorer) token or with a managed identity. The option you choose affects what kind of URL you use as the value for WEBSITE_RUN_FROM_PACKAGE.
163+
>
164+
>Whenever you deploy the package file that a function app references, you must [manually sync triggers](#trigger-syncing), including the initial deployment. When you change the contents of the package file and not the URL itself, you must also restart your function app to sync triggers. Refer to our [how-to guide](run-functions-from-deployment-package.md#use-website_run_from_package--url) on configuring this deployment technology.
165+
166+
>__When to use it:__ External package URL is the only supported deployment method for apps running on the Linux Consumption plan when you don't want a [remote build](#remote-build) to occur. This method is also the recommended deployment technology when you [create your app without Azure Files](storage-considerations.md#create-an-app-without-azure-files).
141167
142-
>__Where app content is stored:__ App content from a zip deploy by default is stored on the file system, which may be backed by Azure Files from the storage account specified when the function app was created. In Linux Consumption, the app content instead is persisted on a blob in the storage account specified by the `AzureWebJobsStorage` connection.
168+
>__Where app content is stored:__ You are responsible for uploading your app content to blob storage. You may use any blob storage account, though Azure Blob Storage is recommended.
143169
144170
### Docker container
145171

0 commit comments

Comments
 (0)