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
@@ -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,7 +274,7 @@ 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 Piplines 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,65 +662,93 @@ 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
-
## Configure monitoring
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.
666
695
667
-
The following metrics are specifically available for Flex Consumption apps:
696
+
In the Azure portal, you can also create metrics alerts and pin charts and other reports to dashboards in the portal.
668
697
669
-
##### [Azure CLI](#tab/azure-cli)
698
+
### [Azure CLI](#tab/azure-cli)
699
+
700
+
Use this script to generate a report of the current metrics for your app:
670
701
671
702
```azurecli
672
-
# First, get the resource ID of your Flex Consumption function app (required for metrics commands)
673
-
ResourceId=$(az functionapp show --name <FunctionAppName> --resource-group <ResourceGroupName> --query id -o tsv)
674
-
echo "Function App Resource ID: $ResourceId"
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)
675
706
676
-
# Monitor Always Ready and On Demand execution counts
677
-
az monitor metrics list --resource $ResourceId --metric "AlwaysReadyFunctionExecutionCount" --interval PT1H --output table
678
-
az monitor metrics list --resource $ResourceId --metric "OnDemandFunctionExecutionCount" --interval PT1H --output table
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
679
710
680
-
# Monitor execution units (MB-milliseconds) in Always Ready and On Demand instances
681
-
az monitor metrics list --resource $ResourceId --metric "AlwaysReadyFunctionExecutionUnits" --interval PT1H --output table
682
-
az monitor metrics list --resource $ResourceId --metric "OnDemandFunctionExecutionUnits" --interval PT1H --output table
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
683
714
684
-
# Monitor Always Ready resource utilization
685
-
az monitor metrics list --resource $ResourceId --metric "AlwaysReadyUnits" --interval PT1H --output table
715
+
echo -e "\nAlways-ready resource utilization..."
716
+
az monitor metrics list --resource $appId --metric "AlwaysReadyUnits" --interval PT1H --output table
686
717
687
-
# Monitor memory utilization
688
-
az monitor metrics list --resource <ResourceId> --metric "AverageMemoryWorkingSet" --interval PT1H --output table
689
-
az monitor metrics list --resource <ResourceId> --metric "MemoryWorkingSet" --interval PT1H --output table
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
690
721
691
-
# Monitor instance count and CPU utilization
692
-
az monitor metrics list --resource <ResourceId> --metric "InstanceCount" --interval PT1H --output table
693
-
az monitor metrics list --resource <ResourceId> --metric "CpuPercentage" --interval PT1H --output table
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
694
725
```
695
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.
696
738
697
-
##### [Azure portal](#tab/azure-portal)
698
-
699
-
1.**Function App Metrics**:
700
-
+ Navigate to your Flex Consumption function app in Azure Portal
701
-
+ Go to "Metrics" under the "Monitoring" section
702
-
+ Click "Add metric" and explore the available metrics:
703
-
+**Always Ready metrics**: Always Ready Function Execution Count, Always Ready Function Execution Units, Always Ready Units
704
-
+**On Demand metrics**: On Demand Function Execution Count, On Demand Function Execution Units
705
-
+**Memory metrics**: Average Memory Working Set, Memory Working Set
706
-
+**Performance metrics**: Instance Count, Cpu Percentage
707
-
+ Create custom charts combining related metrics for better visibility
708
-
+ Use "Add filter" to focus on specific functions or dimensions
709
-
710
-
2.**Custom Monitoring Dashboards**:
711
-
+ Create a dedicated dashboard for monitoring your Flex Consumption app
712
-
+ Add multiple metric charts to track different aspects of performance
713
-
+ Include both Always Ready and On Demand metrics for complete visibility
714
-
+ Set up alerts for key metrics that exceed expected thresholds
You can't currently review and set metrics using Visual Studio Code.
764
+
### View costs
738
765
739
-
---
766
+
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.
740
786
741
787
## Related content
742
788
@@ -745,3 +791,5 @@ You can't currently review and set metrics using Visual Studio Code.
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).
0 commit comments