Skip to content

Commit 4645983

Browse files
Merge pull request #274151 from ggailey777/patch-3
[Functions] peer-review updates for functions-continuous-deployment.md
2 parents 281a646 + 5838766 commit 4645983

File tree

1 file changed

+23
-31
lines changed

1 file changed

+23
-31
lines changed

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

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ title: Continuous deployment for Azure Functions
33
description: Use the continuous deployment features of Azure App Service when publishing to Azure Functions.
44
ms.assetid: 361daf37-598c-4703-8d78-c77dbef91643
55
ms.topic: conceptual
6-
ms.date: 04/10/2024
6+
ms.date: 05/01/2024
77
#Customer intent: As a developer, I want to learn how to set up a continuous integration environment so that function app updates are deployed automatically when I check in my code changes.
88
---
99

1010
# Continuous deployment for Azure Functions
1111

12-
You can use Azure Functions to deploy your code continuously by using [source control integration](functions-deployment-technologies.md#source-control). Source control integration enables a workflow in which a code update triggers build, packaging, and deployment from your project to Azure.
12+
Azure Functions enables you to continuously deploy the changes made in a source control repository to a connected function app. This [source control integration](functions-deployment-technologies.md#source-control) enables a workflow in which a code update triggers build, packaging, and deployment from your project to Azure.
1313

14-
Continuous deployment is a good option for projects where you integrate multiple and frequent contributions. When you use continuous deployment, you maintain a single source of truth for your code, which allows teams to easily collaborate.
14+
You should always configure continuous deployment for a staging slot and not for the production slot. When you use the production slot, code updates are pushed directly to production without being verified in Azure. Instead, enable continuous deployment to a staging slot, verify updates in the staging slot, and after everything runs correctly you can [swap the staging slot code into production](./functions-deployment-slots.md#swap-slots). If you connect to a production slot, make sure that only production-quality code makes it into the integrated code branch.
1515

16-
Steps in this article show you how to configure continuous code deployments to your function app in Azure by using the Deployment Center in the Azure portal. You can also configure continuous integration using the Azure CLI.
16+
Steps in this article show you how to configure continuous code deployments to your function app in Azure by using the Deployment Center in the Azure portal. You can also [configure continuous integration using the Azure CLI](/cli/azure/functionapp/deployment). These steps can target either a staging or a production slot.
1717

1818
Functions supports these sources for continuous deployment to your app:
1919

2020
### [Azure Repos](#tab/azure-repos)
2121

22-
Maintain your project code in [Azure Repos](https://azure.microsoft.com/services/devops/repos/), one of the services in Azure DevOps. Supports both Git and Team Foundation Version Control. Used with the [Azure Pipelines build provider](functions-continuous-deployment.md?tabs=azure-repos%2azure-pipelines#build-providers)). For more information, see [What is Azure Repos?](/azure/devops/repos/get-started/what-is-repos)
22+
Maintain your project code in [Azure Repos](https://azure.microsoft.com/services/devops/repos/), one of the services in Azure DevOps. Supports both Git and Team Foundation Version Control. Used with the [Azure Pipelines build provider](functions-continuous-deployment.md?tabs=azure-repos%2azure-pipelines#build-providers). For more information, see [What is Azure Repos?](/azure/devops/repos/get-started/what-is-repos)
2323

2424
### [GitHub](#tab/github)
2525

@@ -44,37 +44,43 @@ You can also connect your function app to an external Git repository, but this r
4444
4545
## Requirements
4646

47-
For continuous deployment to succeed, your directory structure must be compatible with the basic folder structure that Azure Functions expects.
47+
The unit of deployment for functions in Azure is the function app. For continuous deployment to succeed, the directory structure of your project must be compatible with the basic folder structure that Azure Functions expects. When you create your code project using Azure Functions Core Tools, Visual Studio Code, or Visual Studio, the Azure Functions templates are used to create code projects with the correct directory structure. All functions in a function app are deployed at the same time and in the same package.
4848

49-
[!INCLUDE [functions-folder-structure](../../includes/functions-folder-structure.md)]
49+
After you enable continuous deployment, access to function code in the Azure portal is configured as *read-only* because the _source of truth_ is known to reside elsewhere.
5050

51-
## Build providers
51+
>[!NOTE]
52+
>The Deployment Center doesn't support enabling continuous deployment for a function app with [inbound network restrictions](functions-networking-options.md?#inbound-networking-features). You need to instead configure the build provider workflow directly in GitHub or Azure Pipelines. These workflows also require you to use a virtual machine in the same virtual network as the function app as either a [self-hosted agent (Pipelines)](/azure/devops/pipelines/agents/agents#self-hosted-agents) or a [self-hosted runner (GitHub)](https://docs.github.com/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners).
53+
54+
## <a name="build-providers"></a>Select a build provider
5255

5356
Building your code project is part of the deployment process. The specific build process depends on your specific language stack, operating system, and hosting plan. Builds can be done locally or remotely, again depending on your specific hosting. For more information, see [Remote build](functions-deployment-technologies.md#remote-build).
5457

58+
> [!IMPORTANT]
59+
> For increased security, consider using a build provider that supports managed identities, including Azure Pipelines and Gitub Actions. The App Service (Kudu) service requires you to [enable basic authenication](#enable-basic-authentication-for-deployments) and work with text-based credentials.
60+
5561
Functions supports these build providers:
5662

5763
### [Azure Pipelines](#tab/azure-pipelines)
5864

59-
Azure Pipelines is one of the services in Azure DevOps and the default build provider for Azure Repos projects. You can also use Pipelines to build projects from GitHub. In Pipelines, there's an `AzureFunctionApp` task designed specifically for deploying to Azure Functions. This task provides you with control over how the project gets built, packaged, and deployed.
65+
Azure Pipelines is one of the services in Azure DevOps and the default build provider for Azure Repos projects. You can also use Pipelines to build projects from GitHub. In Pipelines, there's an [`AzureFunctionApp`](/azure/devops/pipelines/tasks/reference/azure-function-app-v2) task designed specifically for deploying to Azure Functions. This task provides you with control over how the project gets built, packaged, and deployed. Supports managed identities.
6066

6167
### [GitHub Actions](#tab/github-actions)
6268

63-
GitHub Actions is the default build provider for GitHub projects. GitHub Actions provides you with control over how the project gets built, packaged, and deployed.
69+
GitHub Actions is the default build provider for GitHub projects. GitHub Actions provides you with control over how the project gets built, packaged, and deployed. Supports managed identities.
6470

6571
### [App Service (Kudu) service](#tab/app-service)
6672

67-
The App Service platform maintains a native deployment service ([Project Kudu](https://github.com/projectkudu/kudu/wiki)) to support local Git deployment, some container deployments, and other deployment sources not supported by either Pipelines or GitHub Actions. Remote builds, packaging, and other maintainence tasks are performed in a subdomain of `scm.azurewebsites.net` dedicated to your app, such as `https://myfunctionapp.scm.azurewebsites.net`. This build service can only be used when the `scm` site can be accessed by your deployment. Many publishing tools require basic authentication to connect to the `scm` endpoint. For more information, see [Enable basic authentication for deployments](#enable-basic-authentication-for-deployments).
73+
The App Service platform maintains a native deployment service ([Project Kudu](https://github.com/projectkudu/kudu/wiki)) to support local Git deployment, some container deployments, and other deployment sources not supported by either Pipelines or GitHub Actions. Remote builds, packaging, and other maintainence tasks are performed in a subdomain of `scm.azurewebsites.net` dedicated to your app, such as `https://myfunctionapp.scm.azurewebsites.net`. This build service can only be used when the `scm` site can be accessed by your deployment. Many publishing tools require basic authentication to connect to the `scm` endpoint, which means you can't use managed identities.
6874

69-
This build provider is used when you deploy your code project by using Visual Studio, Visual Studio Code, or Azure Functions Core Tools. If you haven't already deployed by using one of these tools, you might need to Enable basic authentication on the SCM endpoint.
75+
This build provider is used when you deploy your code project by using Visual Studio, Visual Studio Code, or Azure Functions Core Tools. If you haven't already deployed code to your function app by using one of these tools, you might need to [Enable basic authentication for deployments](#enable-basic-authentication-for-deployments) to use the `scm` site.
7076

7177
---
7278

73-
Your options for which of these build providers you can use depend on the specific code deployment source.
79+
Keep the strengths and limitations of these providers in mind when you enable source control integration. You might need to change your repository source type to take advantage of a specific provider.
7480

75-
## <a name="credentials"></a>Deployment center
81+
## <a name="credentials"></a>Configure continuous deployment
7682

77-
The [Azure portal](https://portal.azure.com) provides a **Deployment center** for your function apps, which makes it easier to configure continuous deployment. The way that you configure continuous deployment depends both on the specific source control in which your code resides and the [build provider](#build-providers) you choose.
83+
The [Azure portal](https://portal.azure.com) provides a **Deployment center** for your function apps, which makes it easier to configure continuous deployment. The specific way you configure continuous deployment depends both on the type of source control repository in which your code resides and the [build provider](#build-providers) you choose.
7884

7985
In the [Azure portal](https://portal.azure.com), browse to your function app page and select **Deployment Center** under **Deployment** in the left pane.
8086

@@ -168,21 +174,7 @@ When a new commit is pushed to the local git repository, the service pulls your
168174

169175
After deployment completes, all code from the specified source is deployed to your app. At that point, changes in the deployment source trigger a deployment of those changes to your function app in Azure.
170176

171-
## Considerations
172-
173-
You should keep these considerations in mind when planning for a continuous deployment strategy:
174-
175-
+ GitHub is the only source that currently supports continuous deployment for Linux apps running on a Consumption plan, which is a popular hosting option for Python apps.
176-
177-
+ The unit of deployment for functions in Azure is the function app. All functions in a function app are deployed at the same time and in the same package.
178-
179-
+ After you enable continuous deployment, access to function code in the Azure portal is configured as *read-only* because the _source of truth_ is known to reside elsewhere.
180-
181-
+ You should always configure continuous deployment for a staging slot and not for the production slot. When you use the production slot, code updates are pushed directly to production without being verified in Azure. Instead, enable continuous deployment to a staging slot, verify updates in the staging slot, and after everything runs correctly you can [swap the staging slot code into production](./functions-deployment-slots.md#swap-slots).
182-
183-
+ The Deployment Center doesn't support enabling continuous deployment for a function app with inbound network restrictions. You need instead configure the build provider workflow directly in GitHub or Azure Pipelines. These workflows also require you to use a virtual machine in the same virtual network as the function app as either a [self-hosted agent (Pipelines)](/azure/devops/pipelines/agents/agents#self-hosted-agents) or a [self-hosted runner (GitHub)](https://docs.github.com/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners).
184-
185-
## Continuous deployment during app creation
177+
## Enable continuous deployment during app creation
186178

187179
Currently, you can configure continuous deployment from GitHub using GitHub Actions when you create your function app in the Azure portal. You can do this on the **Deployment** tab in the **Create Function App** page.
188180

@@ -193,7 +185,7 @@ If you want to use a different deployment source or build provider for continuou
193185
By default, your function app is created with basic authentication access to the `scm` endpoint disabled. This blocks publishing by all methods that can't use managed identities to access the `scm` endpoint. The publishing impacts of having the `scm` endpoint disabled are detailed in [Deployment without basic authentication](../app-service/configure-basic-auth-disable.md#deployment-without-basic-authentication).
194186

195187
> [!IMPORTANT]
196-
> When you use basic authenication, credentials are sent in clear text. To protect these credentials, you must only access the `scm` endpoint over an encrypted connection ( HTTPS) when using basic authentication. For more information, see [Secure deployment](security-concepts.md#secure-deployment).
188+
> When you use basic authenication, credentials are sent in clear text. To protect these credentials, you must only access the `scm` endpoint over an encrypted connection (HTTPS) when using basic authentication. For more information, see [Secure deployment](security-concepts.md#secure-deployment).
197189
198190
To enable basic authentication to the `scm` endpoint:
199191

0 commit comments

Comments
 (0)