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/migration/migrate-plan-consumption-to-flex.md
+71-69Lines changed: 71 additions & 69 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,12 @@ This article provides step-by-step instructions for migrating your existing func
16
16
17
17
By migrating your existing serverless apps, your functions can easily take advantage of these benefits of the Flex Consumption plan:
18
18
19
-
+ Improved scalability
20
-
+ Enhanced performance
21
-
+ Improved security and networking.
19
+
+ Enhanced performance: your apps benefit from faster cold starts and improved scalability.
20
+
+ Improved controls: fine-tune your functions with per-function scaling and concurrency settings.
21
+
+ Expanded networking: virtual network integration and private endpoint support lets your functions in both public and private networks.
22
+
+ Managed identity support: easily connect to remote Azure services using Microsoft Entra ID authentication.
22
23
23
-
For more information, see [Flex Consumption plan benefits](../flex-consumption-plan.md#benefits). For a detailed comparison between hosting plans, see [Azure Functions hosting options](../functions-scale.md).
24
+
The Flex Consumption plan is the recommended serverless hosting option for your functions going forward. For more information, see [Flex Consumption plan benefits](../flex-consumption-plan.md#benefits). For a detailed comparison between hosting plans, see [Azure Functions hosting options](../functions-scale.md).
24
25
25
26
## Considerations
26
27
@@ -63,7 +64,7 @@ Before staring a migration, keep these considerations in mind:
63
64
64
65
+ The [`jq` tool](https://jqlang.org/download/), which is used to work with JSON output.
65
66
66
-
#### [Azure portal](#tab/azure-portal)
67
+
### [Azure portal](#tab/azure-portal)
67
68
68
69
+ Access to the [Azure portal]
69
70
@@ -364,9 +365,31 @@ The basic steps to change an existing Blob storage trigger to an Event Grid sour
364
365
365
366
For more information, see [Tutorial: Trigger Azure Functions on blob containers using an event subscription](../functions-event-grid-blob-trigger.md).
366
367
367
-
### Benchmark your current app performance and costs
368
+
### Capture performance benchmarks (optional)
369
+
370
+
If you plan to validate performance improvement in your app based on the migration to the Flex Consumption plan, you should (optionally) capture the performance benchmarks of your current plan. Then, you can compare them to the same benchmarks for your app running in a Flex Consumption plan for comparison.
371
+
372
+
>[!TIP]
373
+
>Always compare performance under similar conditions, such as time-of-day, day-of-week, and client load. Try to run the two benchmarks as close together as possible.
374
+
375
+
Here are some benchmarks to consider for your structured performance testing:
376
+
377
+
| Suggested benchmark | Comment |
378
+
| ----- | ----- |
379
+
|**Cold-start**| Measure the time from first request to the first response after an idle period. Test with different memory allocation settings in Flex Consumption. |
380
+
|**Throughput**| Measure the maximum requests-per-second using [load testing tools](/azure/load-testing/how-to-optimize-azure-functions) to determine how the app handles concurrent requests. |
381
+
|**Latency**| Track the `P50`, `P95`, and `P99` response times under various load conditions. You can monitor these metrics in Application Insights. |
382
+
383
+
You can use this Kusto query to review the suggested latency response times in Application Insights:
384
+
385
+
```kusto
386
+
requests
387
+
| where timestamp > ago(1d)
388
+
| summarize percentiles(duration, 50, 95, 99) by bin(timestamp, 1h)
389
+
| render timechart
390
+
```
391
+
368
392
369
-
`<<TODO: recommend performance and cost benchmarks that also apply to Flex apps for comparison post-migration>>`
370
393
371
394
## Consider dependent services
372
395
@@ -410,6 +433,7 @@ You should complete these tasks before you migrate your app to run in a Flex Con
@@ -670,6 +694,8 @@ The location of your project source files depends on the `WEBSITE_RUN_FROM_PACKA
670
694
671
695
---
672
696
697
+
Use these steps to download the deployment package from your current app:
698
+
673
699
#### [Linux](#tab/linux/azure-cli)
674
700
675
701
1. Use this [`az functionapp config appsettings list`](/cli/azure/functionapp/config/appsettings#az-functionapp-config-appsettings-list) command to get the `WEBSITE_RUN_FROM_PACKAGE` app setting, if present:
@@ -1369,7 +1395,7 @@ Functions provides several ways to deploy your code, either from the code projec
1369
1395
>[!TIP]
1370
1396
>If your project code is maintained in a source code repository, this is the perfect time to configure a continuous deployment pipeline. Continuous deployment lets you automatically deploy application updates based on changes in a connected repository.
You should update your existing deployment workflows to deploy your source code to your new app:
1375
1401
@@ -1378,7 +1404,7 @@ You should update your existing deployment workflows to deploy your source code
1378
1404
1379
1405
You can also create a new continuous deployment workflow for your new app. For more information, see [Continuous deployment for Azure Functions](../functions-continuous-deployment.md)
1380
1406
1381
-
#####[Ad-hoc code deployment](#tab/ad-hoc-code)
1407
+
#### [Ad-hoc code deployment](#tab/ad-hoc)
1382
1408
1383
1409
You can use these tools to acheive a one-off deployment of your code project to your new plan:
1384
1410
@@ -1413,25 +1439,55 @@ If your app hasn't
1413
1439
1414
1440
## Post-migration tasks
1415
1441
1416
-
### Verify Basic Functionality
1442
+
After a successful migration, you should perform these follow-up tasks:
1417
1443
1418
-
1. Verify the Function App is running on the Flex Consumption plan:
1444
+
###Verify basic functionality
1419
1445
1446
+
1. Verify the new app is running in a Flex Consumption plan:
1447
+
1448
+
#### [Azure CLI](#tab/azure-cli)
1449
+
1450
+
Use this [`az functionapp show`](/cli/azure/functionapp?view=azure-cli-latest#az-functionapp-show) command two view the details about the hosting plan:
1451
+
1420
1452
```azurecli
1421
-
az functionapp show --name <FunctionAppName> --resource-group <ResourceGroupName> --query "serverFarmId"
1453
+
az functionapp show --name <APP_NAME> --resource-group <RESOURCE_GROUP> --query "serverFarmId"
1422
1454
```
1455
+
1456
+
In this example, replace `<RESOURCE_GROUP>` and `<APP_NAME>` with your resource group and function app names, respectively.
1457
+
1458
+
#### [Azure portal](#tab/azure-portal)
1459
+
1460
+
1461
+
1462
+
---
1463
+
1464
+
1. Use an HTTP client to call at least one HTTP trigger endpoint on your new app to make sure it responds as expected.
1465
+
1466
+
1. View the current logs for your new app to verify that requests are
1467
+
1468
+
Call
1423
1469
1424
1470
2. Make sure Application Insights is configured for your function app, then monitor function execution through Application Insights in the Azure Portal through the Application Insights resource or use the App Insights query API.
1425
1471
1426
-
### Enable monitoring
1472
+
### Redirect HTTP endpoints
1427
1473
1428
-
After migrating to Flex Consumption, implement a structured monitoring approach to ensure optimal performance and detect any issues. For more information, see [Configure monitoring](../flex-consumption-how-to.md#configure-monitoring).
1474
+
If you haven't already done so, ,
1475
+
1476
+
2. Validate functionality with test requests
1477
+
3. Update DNS or client configuration to point to the new app (if using custom domains)
1478
+
4. Consider implementing a temporary redirect from the old app to the new one for any clients still using the old endpoint.
1429
1479
1430
1480
1431
1481
1432
1482
1483
+
### Enable monitoring
1484
+
1485
+
After a successful migration, make sure that Application Insights in enabled in your new app. Implement a structured monitoring approach to ensure optimal performance and detect any issues. For more information, see [Configure monitoring](../flex-consumption-how-to.md#configure-monitoring) in the Flex Consumption plan article.
1486
+
1433
1487
### Capture performance and cost benchmarks
1434
1488
1489
+
1490
+
1435
1491
>[!NOTE]
1436
1492
>Flex Consumption plan metrics differ from Consumption plan metrics. When comparing performance before and after migration, keep in mind that you must use different metrics to track similar performance characteristics.
1437
1493
@@ -1443,12 +1499,6 @@ We recommend waiting at least a few days or even weeks (depending on your applic
> **Warning**: This action will delete your original function app but leaves the Consumption plan intact if other apps are using it. Before deleting, ensure you have successfully migrated all functionality to the new Flex Consumption app, verified no traffic is being directed to the original app, and backed up any relevant logs, configuration, or data that might be needed for reference.
1469
1519
1470
-
### Performance Benchmarking
1471
-
1472
-
Conduct structured performance testing to compare the migrated app against your original Linux Consumption app:
1473
-
1474
-
1.**Cold Start Comparison**:
1475
-
+ Measure the time from first request to response after idle periods
1476
-
+ Test with different memory allocation settings in Flex Consumption
1477
-
1478
-
2.**Throughput Testing**:
1479
-
+ Measure maximum requests per second using [load testing tools](https://learn.microsoft.com/en-us/azure/load-testing/how-to-optimize-azure-functions)
1480
-
+ Compare how both plans handle concurrent requests
1481
-
1482
-
3.**Latency Analysis**:
1483
-
+ Track the P50, P95, and P99 response times under various load conditions
1484
-
+ Monitor these metrics in Application Insights:
1485
-
1486
-
```kusto
1487
-
requests
1488
-
| where timestamp > ago(1d)
1489
-
| summarize percentiles(duration, 50, 95, 99) by bin(timestamp, 1h)
1490
-
| render timechart
1491
-
```
1492
1520
1493
1521
### Cost Monitoring
1494
1522
@@ -1555,17 +1583,6 @@ Despite careful planning, migration issues may occur. Here's how to handle diffe
3. Update DNS or client configuration to point to the new app (if using custom domains)
1565
-
4. Consider implementing a temporary redirect from the old app to the new one for any clients still using the old endpoint.
1566
-
1567
-
1568
-
1569
1586
## What to expect after migration
1570
1587
1571
1588
After migrating from Linux Consumption to Flex Consumption, you can expect several operational differences:
@@ -1589,28 +1606,13 @@ After migrating from Linux Consumption to Flex Consumption, you can expect sever
1589
1606
1590
1607
> **Note**: Actual performance improvements and cost implications can vary based on your specific workload patterns and function app configuration. Monitor performance metrics after migration to optimize your configuration.
1591
1608
1592
-
### Networking Features
1593
-
1594
-
+ **Enhanced VNet Integration**: Full VNet integration capabilities, allowing access to private endpoints and services.
1595
-
+ **Private Endpoint Support**: Support for private endpoints, enabling private access to your function app.
1596
-
+ **Network Security Group Support**: More granular network security controls than were available with Linux Consumption.
1597
-
1598
1609
## Conclusion
1599
1610
1600
1611
Congratulations on successfully migrating your Azure function app from Linux Consumption to Flex Consumption! This migration represents a significant improvement in your serverless architecture that will benefit both your users and your organization.
1601
1612
1602
-
By completing this migration, you've:
1603
-
1604
-
+ **Enhanced your application performance** with faster cold starts and improved scalability
1605
-
+ **Gained more granular control** over your functions with per-function scaling and concurrency settings
1606
-
+ **Improved your networking capabilities** with better VNet integration and private endpoint support
1607
-
+ **Positioned your application for future growth** on a modern, actively developed hosting platform
1608
-
1609
-
Remember to continue monitoring your application in its new environment and fine-tune the settings to optimize cost and performance. The Azure Functions team is continuously evolving the Flex Consumption plan with new features and improvements, so stay informed about new capabilities by regularly checking the [Azure Functions documentation](https://learn.microsoft.com/en-us/azure/azure-functions/).
1610
1613
1611
-
Thank you for following this migration guide. Your investment in modernizing your Azure Functions will pay dividends in improved performance, scalability, and security for your applications.
1614
+
Remember to continue monitoring your application in its new environment and fine-tune the settings to optimize cost and performance. The Azure Functions team is continuously evolving the Flex Consumption plan with new features and improvements, so stay informed about new capabilities by regularly checking the [Azure Functions documentation](../azure-functions/).
0 commit comments