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/azure-functions/flex-consumption-how-to.md
+133-9Lines changed: 133 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,7 +133,7 @@ To support your function code, you need to create three resources:
133
133
This command creates a function app running in the Flex Consumption plan.
134
134
135
135
Because you created the app without specifying [always ready instances](#set-always-ready-instance-counts), your app only incurs costs when actively executing functions. The command also creates an associated Azure Application Insights instance in the same resource group, with which you can monitor your function app and view logs. For more information, see [Monitor Azure Functions](functions-monitoring.md).
136
-
```
136
+
137
137
138
138
### [Azure portal](#tab/azure-portal)
139
139
@@ -183,7 +183,7 @@ You can use the Azure CLI to upload a deployment package file to the deployment
183
183
This package file must contain all of the build output files and referenced libraries required for your project to run.
184
184
::: zone-end
185
185
::: zone pivot="programming-language-javascript,programming-language-typescript"
186
-
For projects with a large amount of libraries, you should package the root of your project file and request a [remote build].
186
+
For projects with a large number of libraries, you should package the root of your project file and request a [remote build].
187
187
::: zone-end
188
188
::: zone pivot="programming-language-python"
189
189
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.
@@ -274,14 +274,14 @@ For Python projects, you should package the root of your project file and always
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:
277
+
Azure Functions has both a custom GitHub Action and a custom Azure Pipelines Task to support continuous deployment. Refer the following guides to incorporate these tools in your CI/CD pipelines:
278
278
279
279
- [Build and deploy using Azure Pipelines](./functions-how-to-azure-devops.md)
280
280
- [Build and deploy using GitHub Actions](./functions-how-to-github-actions.md)
@@ -412,7 +412,7 @@ az functionapp vnet-integration list --resource-group <RESOURCE_GROUP> --name <A
412
412
413
413
You can integrate your existing app with an existing virtual network and subnet in the portal.
414
414
415
-
1. In your function app page in the [Azure portal](https://portal.azure.com), expand **Settings** in the left menu and select **Networking**.
415
+
1. In your function app page in the [Azure portal], expand **Settings** in the left menu and select **Networking**.
416
416
417
417
1. Under **Outbound traffic configuration**, select **Not configured**.
418
418
@@ -493,7 +493,7 @@ az functionapp deployment config set --resource-group <RESOURCE_GROUP> --name <A
493
493
494
494
### [Azure portal](#tab/azure-portal)
495
495
496
-
1. In your function app page in the [Azure portal](https://portal.azure.com), expand **Settings** in the left menu and select **Deployment settings**.
496
+
1. In your function app page in the [Azure portal], expand **Settings** in the left menu and select **Deployment settings**.
497
497
498
498
1. Under Application package location, select an existing **Storage account** and then select an existing empty **container** in the account.
499
499
@@ -548,7 +548,7 @@ az functionapp scale config set --resource-group <resourceGroup> --name <APP_NAM
548
548
549
549
### [Azure portal](#tab/azure-portal)
550
550
551
-
1. In your function app page in the [Azure portal](https://portal.azure.com), expand **Settings** in the left menu and select **Scale and concurrency**.
551
+
1. In your function app page in the [Azure portal], expand **Settings** in the left menu and select **Scale and concurrency**.
552
552
553
553
1. Select an **Instance memory** option and select **Save** to update the app.
1. In your function app page in the [Azure portal](https://portal.azure.com), expand **Settings** in the left menu and select **Scale and concurrency**.
615
+
1. In your function app page in the [Azure portal], expand **Settings** in the left menu and select **Scale and concurrency**.
616
616
617
617
1. Under **Always-ready instance minimum** type `http`, `blob`, `durable`, or a specific function name using the format `function:<FUNCTION_NAME>=n` in **Trigger** and type the **Number of always-ready instances**.
618
618
@@ -642,7 +642,7 @@ This example sets the HTTP trigger concurrency level to `10`. After you specific
642
642
643
643
### [Azure portal](#tab/azure-portal)
644
644
645
-
1. In your function app page in the [Azure portal](https://portal.azure.com), expand **Settings** in the left menu and select **Scale and concurrency**.
645
+
1. In your function app page in the [Azure portal], expand **Settings** in the left menu and select **Scale and concurrency**.
646
646
647
647
1. Under **Concurrency per instance** select **Assign manually** and type a specific limit.
648
648
@@ -662,10 +662,134 @@ To view the list of regions that currently support Flex Consumption plans:
662
662
663
663
When you create an app in the [Azure portal](flex-consumption-how-to.md?tabs=azure-portal#create-a-flex-consumption-app) or by using [Visual Studio Code](flex-consumption-how-to.md?tabs=vs-code#create-a-flex-consumption-app), currently unsupported regions are filtered out of the region list.
664
664
665
+
## Monitor your app in Azure
666
+
667
+
Azure Monitor provides these distinct sets of metrics to help you better understand how your function app runs in Azure:
+ Application Insights: provides code-level insights, including traces and errors logs.
671
+
672
+
If you haven't done so already, you should [enable Application Insights in your app](configure-monitoring.md#enable-application-insights-integration) to be able to:
673
+
674
+
+ Track detailed execution times and dependencies
675
+
+ Monitor individual function performance
676
+
+ Analyze failures and exceptions
677
+
+ Correlate platform metrics with application behavior with custom queries
678
+
679
+
For more information, see [Monitor Azure Functions](monitor-functions.md).
680
+
681
+
### Supported metrics
682
+
683
+
Run this script to view all of the platform metrics that are currently available your app:
684
+
685
+
```azurecli
686
+
appId=$(az functionapp show --name <APP_NAME> --resource-group <RESOURCE_GROUP> --query id -o tsv)
687
+
az monitor metrics list-definitions --resource $appId --query "[].{Name:name.localizedValue,Value:name.value}" -o table
688
+
```
689
+
690
+
In this example, replace `<RESOURCE_GROUP>` and `<APP_NAME>` with your resource group and function app names, respectively. This script gets the fully qualified app ID and returns the available platform metrics in a table.
691
+
692
+
### View metrics
693
+
694
+
You can review current metrics either in the Azure portal or by using the Azure CLI.
695
+
696
+
In the Azure portal, you can also create metrics alerts and pin charts and other reports to dashboards in the portal.
697
+
698
+
### [Azure CLI](#tab/azure-cli)
699
+
700
+
Use this script to generate a report of the current metrics for your app:
701
+
702
+
```azurecli
703
+
appId=$(az functionapp show --name <APP_NAME> --resource-group <RESOURCE_GROUP> --query id -o tsv)
704
+
705
+
appId=$(az functionapp show --name func-fuxigh6c255de --resource-group exampleRG --query id -o tsv)
706
+
707
+
echo -e "\nAlways-ready and on-emand execution counts..."
708
+
az monitor metrics list --resource $appId --metric "AlwaysReadyFunctionExecutionCount" --interval PT1H --output table
709
+
az monitor metrics list --resource $appId --metric "OnDemandFunctionExecutionCount" --interval PT1H --output table
710
+
711
+
echo -e "\nExecution units (MB-ms) in always-ready and on-emand execution counts..."
712
+
az monitor metrics list --resource $appId --metric "AlwaysReadyFunctionExecutionUnits" --interval PT1H --output table
713
+
az monitor metrics list --resource $appId --metric "OnDemandFunctionExecutionUnits" --interval PT1H --output table
714
+
715
+
echo -e "\nAlways-ready resource utilization..."
716
+
az monitor metrics list --resource $appId --metric "AlwaysReadyUnits" --interval PT1H --output table
717
+
718
+
echo -e "\nMemory utilization..."
719
+
az monitor metrics list --resource $appId --metric "AverageMemoryWorkingSet" --interval PT1H --output table
720
+
az monitor metrics list --resource $appId --metric "MemoryWorkingSet" --interval PT1H --output table
721
+
722
+
echo -e "\nInstance count and CPU utilization..."
723
+
az monitor metrics list --resource $appId --metric "InstanceCount" --interval PT1H --output table
724
+
az monitor metrics list --resource $appId --metric "CpuPercentage" --interval PT1H --output table
725
+
```
726
+
727
+
### [Azure portal](#tab/azure-portal)
728
+
729
+
1. In your function app page in the [Azure portal], select **Monitoring** > **Metrics** and if the current chart is blank, select **+ Add metric**.
730
+
731
+
1. With your app as the **Scope**, choose one or more of the supported **Metric** options to add to the current chart.
732
+
733
+
1. Repeat the previous step to add other metrics to the chart.
734
+
735
+
1. (Optional) Select **Save to dashboard** to add the current chart to a new or existing dashboard. Remember to include both always-ready and on-demand metrics for broad visibility.
736
+
737
+
1. (Optional) Select **New alert rue** to create an alert on a specific metric. Remember to include both always-ready and on-demand metrics for broad visibility.
738
+
739
+
### [Visual Studio Code](#tab/vs-code)
740
+
741
+
You can't currently review and set metrics using Visual Studio Code.
742
+
743
+
---
744
+
745
+
To learn more about metrics for Azure Functions, see [Monitor Azure Functions](monitor-functions.md).
746
+
747
+
### View logs
748
+
749
+
When your app is connected to Application Insights, you can better analyze your app performance and troubleshoot problems during execution.
750
+
751
+
752
+
+ Use "Performance" to analyze response times and dependencies
753
+
+ Use "Failures" to identify any errors occurring after migration
754
+
+ Create custom queries in "Logs" to analyze function behavior:
Because you can tune your app to adjust performance versus operating costs, it's important to track the costs associated with running your app in the Flex Consumption plan.
767
+
768
+
To view the current costs:
769
+
770
+
1. In your function app page in the [Azure portal], select the resource group link.
771
+
772
+
1. In the resource group page, select **Cost Management** > **Cost analysis**.
773
+
774
+
1. Review the current costs and cost trajectory of the app itself.
775
+
776
+
1. Optionally, select **Cost Management** > **Alerts** and then **+ Add** to create a new alert for the app.
777
+
778
+
## Fine-tune your app
779
+
780
+
The Flex Consumption plan provides several settings that you can tune to refine the performance of your app. Actual performance and costs can vary based on your app-specific workload patterns and configuration. For example, higher [memory instance sizes](./flex-consumption-plan.md#instance-memory) can improve performance for memory-intensive operations but at a higher cost per active period.
781
+
782
+
Here are some adjustments you can make to fine-tune performance versus cost:
783
+
784
+
+ [Adjust concurrency settings](./functions-concurrency.md) to maximize throughput per instance.
785
+
+ [Choose the appropriate memory size](#configure-instance-memory) for your workload. Higher memory sizes cost more but can improve performance.
786
+
665
787
## Related content
666
788
667
789
+ [Azure Functions Flex Consumption plan hosting](flex-consumption-plan.md)
Copy file name to clipboardExpand all lines: articles/azure-functions/flex-consumption-plan.md
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,12 +20,13 @@ You can review end-to-end samples that feature the Flex Consumption plan in the
20
20
21
21
## Benefits
22
22
23
-
The Flex Consumption plan builds on the strengths of the Consumption plan, which include dynamic scaling and execution-based billing. With Flex Consumption, you also get these extra features:
23
+
The Flex Consumption plan builds on the strengths of the serverless Consumption plan, which include dynamic scaling and execution-based billing. With Flex Consumption, you also get these extra features:
+ Fast scaling based on concurrency for both HTTP and non-HTTP apps
28
-
+ Multiple choices for instance memory sizes
25
+
+**Reduced Cold Start Times**: Enable [always-ready instances](#always-ready-instances) to achieve faster cold-start times compared to the Consumption plan.
26
+
+**Virtual network support**: [Virtual network integration](#virtual-network-integration) enables your serverless app to run in a virtual network.
27
+
+**Per-Function Scaling**: Each function in your app [scales independently based on its workload](#per-function-scaling), potentially resulting in more efficient resource allocation.
28
+
+**Improved Concurrency Handling**: Better handling of concurrent executions with configurable concurrency settings per function.
29
+
+**Flexible Memory Configuration**: Flex Consumption offers multiple [instance memory](#instance-memory) size options, allowing you to optimize for your specific workload requirements.
29
30
30
31
This table helps you directly compare the features of Flex Consumption with the Consumption hosting plan:
31
32
@@ -123,18 +124,18 @@ This table shows the language stack versions that are currently supported for Fl
123
124
124
125
Currently, each region in a given subscription has a memory limit of `512,000 MB` for all instances of apps running on Flex Consumption plans. This quota means that, in a given subscription and region, you could have any combination of instance memory sizes and counts, as long as they stay under the quota limit. For example, each the following examples would mean the quota is reached and the apps would stop scaling:
125
126
126
-
+ You have one 512MB app scaled to 250 instances and a second 512MB app scaled to 750 instances.
127
-
+ You have one 512MB app scaled to 1,000 instances.
128
-
+ You have one 2,048MB app scaled to 100 and a second 2,048MB app scaled to 150 instances
129
-
+ You have one 2,048MB app that scaled out to 250 instances
130
-
+ You have one 4,096MB app that scaled out to 125 instances
131
-
+ You have one 4,096MB app scaled to 100 and one 2,048MB app scaled to 50 instances
127
+
+ You have one 512-MB app scaled to 250 instances and a second 512-MB app scaled to 750 instances.
128
+
+ You have one 512-MB app scaled to 1,000 instances.
129
+
+ You have one 2,048-MB app scaled to 100 and a second 2,048-MB app scaled to 150 instances
130
+
+ You have one 2,048-MB app that scaled out to 250 instances
131
+
+ You have one 4,096-MB app that scaled out to 125 instances
132
+
+ You have one 4,096-MB app scaled to 100 and one 2,048-MB app scaled to 50 instances
132
133
133
134
Flex Consumption apps scaled to zero, or instances marked to be scaled in and deleted, don't count against the quota. This quota can be increased to allow your Flex Consumption apps to scale further, depending on your requirements. If your apps require a larger quota, create a support ticket.
134
135
135
136
## Deprecated properties and settings
136
137
137
-
In Flex Consumption many of the standard application settings and site configuration properties are deprecated or have moved and shouldn't be used when automating function app resource creation. For more information, see [Flex Consumption plan deprecations](functions-app-settings.md#flex-consumption-plan-deprecations).
138
+
In the Flex Consumption plan, many of the standard application settings and site configuration properties are deprecated or have moved and shouldn't be used when automating function app resource creation. For more information, see [Flex Consumption plan deprecations](functions-app-settings.md#flex-consumption-plan-deprecations).
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-bindings-error-pages.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ The retry policy tells the runtime to rerun a failed execution until either succ
80
80
A retry policy is evaluated when a function executed by a supported trigger type raises an uncaught exception. As a best practice, you should catch all exceptions in your code and raise new exceptions for any errors that you want to result in a retry.
81
81
82
82
> [!IMPORTANT]
83
-
> Event Hubs checkpoints aren't written until after the retry policy for the execution finishes. Because of this behavior, progress on the specific partition is paused until the current batch is done processing.
83
+
> Event Hubs checkpoints aren't written until after the retry policy for the execution finishes. Because of this behavior, progress on the specific partition is paused until the current batch is done processing. For more information, see [Azure Functions reliable event processing](functions-reliable-event-processing.md).
84
84
>
85
85
> The version 5.x of the Event Hubs extension supports extra retry capabilities for interactions between the Functions host and the event hub. For more information, see `clientRetryOptions` in the [Event Hubs host.json reference](functions-bindings-event-hubs.md#host-json).
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-develop-vs.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,8 +47,8 @@ The Azure Functions project template in Visual Studio creates a C# class library
47
47
1. In **Configure your new project**, enter a **Project name** for your project, and then select **Create**. The function app name must be valid as a C# namespace, so don't use underscores, hyphens, or any other nonalphanumeric characters.
48
48
49
49
1. For the **Create a new Azure Functions application** settings, use the values in the following table:
|**.NET version**|**.NET 8 Isolated**| This value creates a function project that runs in an [isolated worker process](dotnet-isolated-process-guide.md). Isolated worker process supports other non-LTS version of .NET and also .NET Framework. For more information, see [Azure Functions runtime versions overview](functions-versions.md). |
@@ -60,6 +60,7 @@ The Azure Functions project template in Visual Studio creates a C# class library
|**.NET version**|**.NET 8**| This value creates a function project that runs in-process with version 4.x of the Azure Functions runtime. For more information, see [Azure Functions runtime versions overview](functions-versions.md). |
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-how-to-use-azure-function-app-settings.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -182,7 +182,12 @@ In the previous example, replace `<RESOURCE_GROUP>` and `<FUNCTION_APP_NAME>` wi
182
182
183
183
## Plan migration
184
184
185
-
You can migrate a function app between a Consumption plan and a Premium plan on Windows. When migrating between plans, keep in mind the following considerations:
185
+
You can migrate a function app between a Consumption plan and a Premium plan on Windows.
186
+
187
+
>[!TIP]
188
+
>We recommend you migrate your Consumption plan app to run in a Flex Consumption plan instead of a Premium plan. This is the only migration option for a Linux Consumption plan app. For more information, see [Migrate Consumption plan apps to the Flex Consumption plan](migration/migrate-plan-consumption-to-flex.md).
189
+
190
+
When migrating between plans, keep in mind the following considerations:
186
191
187
192
+ Direct migration to a Dedicated (App Service) plan isn't supported.
0 commit comments