Skip to content

Commit 9c80ca0

Browse files
committed
Fixes and edits
1 parent 349e0ab commit 9c80ca0

File tree

3 files changed

+129
-52
lines changed

3 files changed

+129
-52
lines changed

articles/azure-functions/flex-consumption-how-to.md

Lines changed: 102 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ To support your function code, you need to create three resources:
7676
az group create --name <RESOURCE_GROUP> --location <REGION>
7777
```
7878
79-
In the above command, replace `<RESOURCE_GROUP>` with a value that's unique in your subscription and `<REGION>` with one of the [currently supported regions](#view-currently-supported-regions). The [az group create](/cli/azure/group#az-group-create) command creates a resource group.
79+
In the previous command, replace `<RESOURCE_GROUP>` with a value that's unique in your subscription and `<REGION>` with one of the [currently supported regions](#view-currently-supported-regions). The [az group create](/cli/azure/group#az-group-create) command creates a resource group.
8080
8181
4. Create a general-purpose storage account in your resource group and region:
8282
@@ -166,41 +166,117 @@ You can skip this section if you choose to instead [create and deploy your app u
166166
167167
You can choose to deploy your project code to an existing function app using various tools:
168168
169-
### [Visual Studio Code](#tab/vs-code-publish)
169+
### [Azure CLI](#tab/azure-cli-publish)
170170
171-
[!INCLUDE [functions-deploy-project-vs-code](../../includes/functions-deploy-project-vs-code.md)]
171+
You can use the Azure CLI to upload a deployment package file to the deployment share for function app in Azure. To do this, you must produce a .zip package file that can run when the package is mounted to your app.
172+
::: zone pivot="programming-language-csharp,programming-language-java"
173+
This package file must contain all of the build output files and referenced libraries required for your project to run.
174+
::: zone-end
175+
::: zone pivot="programming-language-javascript,programming-language-typescript"
176+
For projects with a large amount of libraries, you should package the root of your project file and request a [remote build].
177+
::: zone-end
178+
::: zone pivot="programming-language-python"
179+
For Python projects, you should package the root of your project file and always request a [remote build]. Using a remote build prevents potential issues that can occur when you build a project on Windows to be deployed on Linux.
180+
::: zone-end
181+
::: zone pivot="programming-language-csharp"
182+
1. Using your preferred development tool, build the code project.
172183
173-
### [Azure CLI](#tab/azure-cli)
184+
2. Create a .zip file that contains the output of the build directory. For more information, see [Project structure](dotnet-isolated-process-guide.md#project-structure).
174185
175-
You can use the `az functionapp deployment source config-zip` command to deploy a ready-to-run .zip containing your application package to your function app.
186+
3. When required, sign in to your Azure account and select the active subscription using the [`az login`](/cli/azure/reference-index#az-login) command.
176187
177-
1. First, produce a ready-to-run .zip of your application package. From your project root, perform the required build steps for your project's runtime. Then zip the contents of the build directory. Refer to the "Folder structure" section of your runtime's Developer reference guide ([Python example](./functions-reference-python.md#folder-structure)).
188+
```azurecli
189+
az login
190+
```
178191
179-
1. Before you can deploy, sign in to your Azure subscription using the Azure CLI.
192+
4. Run the [`az functionapp deployment source config-zip`](/cli/azure/functionapp/deployment/source#az-functionapp-deployment-source-config-zip) command to deploy the application package located in the relative `<FILE_PATH>`.
193+
194+
```azurecli
195+
az functionapp deployment source config-zip --src <FILE_PATH> --name <APP_NAME> --resource-group <RESOURCE_GROUP>
196+
```
197+
::: zone-end
198+
::: zone pivot="programming-language-java"
199+
1. Using your preferred development tool, build the code project.
200+
201+
2. Create a .zip file that contains the output of the build directory. For more information, see [Folder structure](./functions-reference-java.md#folder-structure).
202+
203+
3. When required, sign in to your Azure account and select the active subscription using the [`az login`](/cli/azure/reference-index#az-login) command.
180204
181205
```azurecli
182206
az login
183207
```
184208
185-
The [`az login`](/cli/azure/reference-index#az-login) command signs you into your Azure account.
209+
4. Run the [`az functionapp deployment source config-zip`](/cli/azure/functionapp/deployment/source#az-functionapp-deployment-source-config-zip) command to deploy the application package located in the relative `<FILE_PATH>`.
210+
211+
```azurecli
212+
az functionapp deployment source config-zip --src <FILE_PATH> --name <APP_NAME> --resource-group <RESOURCE_GROUP>
213+
```
214+
::: zone-end
215+
::: zone pivot="programming-language-powershell"
216+
1. Create a .zip file that contains the root directory of your code project. For more information, see [Folder structure](./functions-reference-powershell.md#folder-structure).
217+
218+
2. When required, sign in to your Azure account and select the active subscription using the [`az login`](/cli/azure/reference-index#az-login) command.
219+
220+
```azurecli
221+
az login
222+
```
186223
187-
1. Run the following command to deploy the application package located in the relative `<FILE_PATH>`. Only set `--build-remote true` if you need to perform a [remote build](./functions-deployment-technologies.md#remote-build).
224+
3. Run the [`az functionapp deployment source config-zip`](/cli/azure/functionapp/deployment/source#az-functionapp-deployment-source-config-zip) command to deploy the application package located in the relative `<FILE_PATH>`.
188225
189226
```azurecli
190-
az functionapp deployment source config-zip --src <FILE_PATH> --name <APP_NAME> --resource-group <RESOURCE_GROUP> --build-remote false
227+
az functionapp deployment source config-zip --src <FILE_PATH> --name <APP_NAME> --resource-group <RESOURCE_GROUP>
191228
```
229+
::: zone-end
230+
::: zone pivot="programming-language-javascript,programming-language-typescript"
231+
1. Create a .zip file that contains the root directory of your code project. For more information, see [Folder structure](./functions-reference-node.md#folder-structure).
192232
193-
### [Core Tools](#tab/core-tools)
233+
2. When required, sign in to your Azure account and select the active subscription using the [`az login`](/cli/azure/reference-index#az-login) command.
194234
195-
[!INCLUDE [functions-publish-project-CLI-clean](../../includes/functions-publish-project-cli-clean.md)]
235+
```azurecli
236+
az login
237+
```
238+
239+
3. Run the [`az functionapp deployment source config-zip`](/cli/azure/functionapp/deployment/source#az-functionapp-deployment-source-config-zip) command to deploy the application package located in the relative `<FILE_PATH>`.
240+
241+
```azurecli
242+
az functionapp deployment source config-zip --src <FILE_PATH> --name <APP_NAME> --resource-group <RESOURCE_GROUP> --build-remote true
243+
```
244+
245+
Make sure to set `--build-remote true` to perform a [remote build].
246+
::: zone-end
247+
::: zone pivot="programming-language-python"
248+
1. Create a .zip file that contains the root directory of your code project. For more information, see [Folder structure](./functions-reference-python.md#folder-structure).
249+
250+
2. When required, sign in to your Azure account and select the active subscription using the [`az login`](/cli/azure/reference-index#az-login) command.
251+
252+
```azurecli
253+
az login
254+
```
255+
256+
3. Run the [`az functionapp deployment source config-zip`](/cli/azure/functionapp/deployment/source#az-functionapp-deployment-source-config-zip) command to deploy the application package located in the relative `<FILE_PATH>`.
257+
258+
```azurecli
259+
az functionapp deployment source config-zip --src <FILE_PATH> --name <APP_NAME> --resource-group <RESOURCE_GROUP> --build-remote true
260+
```
261+
262+
Make sure to set `--build-remote true` to perform a [remote build].
263+
::: zone-end
196264
197265
### [Continuous Deployment](#tab/continuous-deployment)
198266
199-
Azure Functions has a custom GitHub Action and Azure DevOps Task to support continuous deployment. Please refer the the following guides to incorporate these tools in your CI/CD pipelines:
267+
Azure Functions has a custom GitHub Action and Azure DevOps Task to support continuous deployment. Refer the following guides to incorporate these tools in your CI/CD pipelines:
200268
201269
- [Build and deploy using Azure Pipelines](./functions-how-to-azure-devops.md)
202270
- [Build and deploy using GitHub Actions](./functions-how-to-github-actions.md)
203271
272+
### [Core Tools](#tab/core-tools)
273+
274+
[!INCLUDE [functions-publish-project-CLI-clean](../../includes/functions-publish-project-cli-clean.md)]
275+
276+
### [Visual Studio Code](#tab/vs-code-publish)
277+
278+
[!INCLUDE [functions-deploy-project-vs-code](../../includes/functions-deploy-project-vs-code.md)]
279+
204280
---
205281
206282
::: zone pivot="programming-language-java"
@@ -248,7 +324,7 @@ You can use Maven to create a Flex Consumption hosted function app and required
248324
249325
## Enable virtual network integration
250326
251-
You can enable [virtual network integration](functions-networking-options.md#virtual-network-integration) for your app in a Flex Consumption plan. The examples in this section assume that you already have [created a virtual network with subnet](../virtual-network/quick-create-cli.md#create-a-virtual-network-and-subnet) in your account. You can enable virtual network integration when you create your app or at a later time.
327+
You can enable [virtual network integration](functions-networking-options.md#virtual-network-integration) for your app in a Flex Consumption plan. The examples in this section assume that you've already [created a virtual network with subnet](../virtual-network/quick-create-cli.md#create-a-virtual-network-and-subnet) in your account. You can enable virtual network integration when you create your app or at a later time.
252328
253329
> [!IMPORTANT]
254330
> The Flex Consumption plan currently doesn't support subnets with names that contain underscore (`_`) characters.
@@ -297,8 +373,8 @@ You can't currently enable virtual networking when you use Visual Studio Code to
297373
298374
For end-to-end examples of how to create apps in Flex Consumption with virtual network integration see these resources:
299375
300-
+ [Flex Consumption: HTTP to Event Hubs using VNET Integration](https://github.com/Azure-Samples/azure-functions-flex-consumption-samples/blob/main/README.md)
301-
+ [Flex Consumption: triggered from Service Bus using VNET Integration](https://github.com/Azure-Samples/azure-functions-flex-consumption-samples/blob/main/README.md)
376+
+ [Flex Consumption: HTTP to Event Hubs using virtual network Integration](https://github.com/Azure-Samples/azure-functions-flex-consumption-samples/blob/main/README.md)
377+
+ [Flex Consumption: triggered from Service Bus using virtual network Integration](https://github.com/Azure-Samples/azure-functions-flex-consumption-samples/blob/main/README.md)
302378
303379
To modify or delete virtual network integration in an existing app:
304380
@@ -340,12 +416,12 @@ You can't currently configure virtual networking in Visual Studio Code.
340416

341417
---
342418

343-
When choosing a subnet, these considerations apply:
419+
When you're choosing a subnet, these considerations apply:
344420

345421
+ The subnet you choose can't already be used for other purposes, such as with private endpoints or service endpoints, or be delegated to any other hosting plan or service.
346-
* You cannot share the same subnet between a Container Apps environment and a Flex Consumption app.
347-
+ You can share the same subnet with more than one app running in a Flex Consumption plan. Because the networking resources are shared across all apps, one function app might impact the performance of others on the same subnet.
348-
+ In a Flex Consumption plan, a single function app might use up to 40 IP addresses, even when the app scales beyond 40 instances. While this rule of thumb is helpful when estimating the subnet size you need, it's not strictly enforced.
422+
* You can't share the same subnet between a Container Apps environment and a Flex Consumption app.
423+
+ You can share the same subnet with more than one app running in a Flex Consumption plan. Because the networking resources are shared across all apps, one function app might affect the performance of others on the same subnet.
424+
+ In a Flex Consumption plan, a single function app might use up to 40 IP addresses, even when the app scales beyond 40 instances. While this rule of thumb is helpful when estimating the subnet size you need, it isn't strictly enforced.
349425

350426
## Configure deployment settings
351427

@@ -368,14 +444,14 @@ To configure deployment settings when you create your function app in the Flex C
368444

369445
### [Azure CLI](#tab/azure-cli)
370446

371-
Use the [`az functionapp create`] command and supply these additional options that customize deployment storage:
447+
Use the [`az functionapp create`] command and supply these extra options that customize deployment storage:
372448

373449
| Parameter | Description |
374450
|--|--|--|
375451
| `--deployment-storage-name` | The name of the deployment storage account. |
376452
| `--deployment-storage-container-name` | The name of the container in the account to contain your app's deployment package. |
377453
| `--deployment-storage-auth-type`| The authentication type to use for connecting to the deployment storage account. Accepted values include `StorageAccountConnectionString`, `UserAssignedIdentity`, and `SystemAssignedIdentity`. |
378-
| `--deployment-storage-auth-value` | When using `StorageAccountConnectionString`, this parameter is set to the name of the application setting that contains the connection string to the deployment storage account. When using `UserAssignedIdentity`, this parameter is set to the name of the resource ID of the identity you want to use. |
454+
| `--deployment-storage-auth-value` | When using `StorageAccountConnectionString`, this parameter is set to the name of the application setting that contains the connection string to the deployment storage account. When you set `UserAssignedIdentity`, this parameter is set to the name of the resource ID of the identity you want to use. |
379455

380456
This example creates a function app in the Flex Consumption plan with a separate deployment storage account and user assigned identity:
381457

@@ -475,16 +551,16 @@ You can't currently change the instance memory size setting for your app using V
475551

476552
## Set always ready instance counts
477553

478-
You can set a number of always ready instances for the [Per-function scaling](flex-consumption-plan.md#per-function-scaling) groups or individual functions, to keep your functions loaded and ready to execute. There are three special groups, as in per-function scaling:
554+
You can set a specific number of always ready instances for the [Per-function scaling](flex-consumption-plan.md#per-function-scaling) groups or individual functions, to keep your functions loaded and ready to execute. There are three special groups, as in per-function scaling:
479555
+ `http` - all the HTTP triggered functions in the app scale together into their own instances.
480556
+ `durable` - all the Durable triggered functions (Orchestration, Activity, Entity) in the app scale together into their own instances.
481557
+ `blob` - all the blob (Event Grid) triggered functions in the app scale together into their own instances.
482558

483-
Use `http`, `durable` or `blob` as the name for the name value pair setting to configure always ready counts for these groups. For all other functions in the app you need to configure always ready for each individual function using the format `function:<FUNCTION_NAME>=n`.
559+
Use `http`, `durable`, or `blob` as the name for the name value pair setting to configure always ready counts for these groups. For all other functions in the app you need to configure always ready for each individual function using the format `function:<FUNCTION_NAME>=n`.
484560

485561
### [Azure CLI](#tab/azure-cli)
486562

487-
Use the `--always-ready-instances` parameter with the [`az functionapp create`] command to define one or more always ready instance designations. This example sets the always ready instance count for all HTTP triggered functions to `5`:
563+
To define one or more always ready instance designations, use the `--always-ready-instances` parameter with the [`az functionapp create`] command. This example sets the always ready instance count for all HTTP triggered functions to `5`:
488564

489565
```azurecli
490566
az functionapp create --resource-group <RESOURCE_GROUP> --name <APP_NAME> --storage <STORAGE_NAME> --runtime <LANGUAGE_RUNTIME> --runtime-version <RUNTIME_VERSION> --flexconsumption-location <REGION> --always-ready-instances http=10
@@ -582,3 +658,4 @@ When you create an app in the [Azure portal](flex-consumption-how-to.md?tabs=azu
582658
+ [Azure Functions hosting options](functions-scale.md)
583659

584660
[`az functionapp create`]: /cli/azure/functionapp#az-functionapp-create
661+
[remote build]: ./functions-deployment-technologies.md#remote-build

0 commit comments

Comments
 (0)