[App Service] Update functionapp commands to show warning for Linux consumption EOL and recommend Flex consumption for all consumption apps#33445
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull request overview
This PR aims to surface guidance in az functionapp flows by warning users about Linux Consumption end-of-life (Sep 30, 2028) and recommending migration to Flex Consumption, while also updating App Service functionapp tests/recordings.
Changes:
- Adds a new
warn_linux_consumption_eolhelper and wires it into several validators to emit EOL/migration warnings. - Adds additional consumption-plan warnings during
az functionapp create(Linux EOL + Flex recommendation; Windows recommendation). - Updates scenario tests and recordings (PowerShell runtime version expectations, plan deletion command/recordings).
Reviewed changes
Copilot reviewed 5 out of 32 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/appservice/_params.py |
Adds warn_linux_consumption_eol as an argument validator for functionapp --name. |
src/azure-cli/azure/cli/command_modules/appservice/_validators.py |
Introduces warn_linux_consumption_eol and invokes it from multiple validators. |
src/azure-cli/azure/cli/command_modules/appservice/custom.py |
Emits new warnings during create_functionapp for consumption plans. |
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py |
Updates PowerShell version expectations and fixes an incorrect delete command. |
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/recordings/test_functionapp_on_windows_app_service_dotnet_with_runtime_version.yaml |
Re-recorded HTTP interactions reflecting updated runtime/locations and request payloads. |
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/recordings/test_functionapp_elastic_plan.yaml |
Re-recorded interactions reflecting functionapp plan delete behavior and updated locations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| with self.argument_context('functionapp') as c: | ||
| c.ignore('app_instance') | ||
| c.argument('resource_group_name', arg_type=resource_group_name_type) | ||
| c.argument('location', arg_type=get_location_type(self.cli_ctx)) | ||
| c.argument('slot', options_list=['--slot', '-s'], | ||
| help="the name of the slot. Default to the productions slot if not specified") | ||
| c.argument('name', arg_type=functionapp_name_arg_type, validator=warn_linux_consumption_eol) |
| resource_group_name = getattr(namespace, 'resource_group_name', None) | ||
| name = _get_app_name(namespace) | ||
| slot = getattr(namespace, 'slot', None) | ||
| if not name or not resource_group_name: | ||
| return | ||
|
|
||
| functionapp = _generic_site_operation(cmd.cli_ctx, resource_group_name, name, 'get', slot) | ||
| if functionapp is None: | ||
| return |
| resource_group_name = getattr(namespace, 'resource_group_name', None) | ||
| name = _get_app_name(namespace) | ||
| slot = getattr(namespace, 'slot', None) | ||
| if not name or not resource_group_name: | ||
| return |
| def validate_app_is_functionapp(cmd, namespace): | ||
| client = web_client_factory(cmd.cli_ctx) | ||
| name = _get_app_name(namespace) | ||
| rg = namespace.resource_group | ||
| app = get_resource_if_exists(client.web_apps, name=name, resource_group_name=rg) | ||
| if is_logicapp(app): | ||
| raise ValidationError(f"App '{name}' in group '{rg}' is a logic app.") | ||
| if is_webapp(app): | ||
| raise ValidationError(f"App '{name}' in group '{rg}' is a web app.") | ||
| warn_linux_consumption_eol(cmd, namespace) | ||
|
|
|
|
||
| # Show warnings for Consumption plan (Linux or Windows) | ||
| # Check if using --consumption-plan-location OR --plan with a consumption SKU (Dynamic tier) | ||
| is_consumption_plan = consumption_plan_location is not None or (plan_info and plan_info.sku.tier == 'Dynamic') |
| logger.warning( | ||
| "Linux Consumption will reach EOL on September 30 2028 and will no longer be supported. " | ||
| "Flex Consumption is now the recommended serverless hosting plan for Azure Functions. " | ||
| "It offers faster scaling, reduced cold starts, private networking, and more control over " | ||
| "performance and cost. Help link: " | ||
| "https://learn.microsoft.com/en-us/azure/azure-functions/migration/migrate-plan-consumption-to-flex" | ||
| ) |
| if plan_info.sku.tier == 'Dynamic': | ||
| logger.warning( | ||
| "Migrate your app to Flex Consumption as Linux Consumption will reach EOL on " | ||
| "September 30 2028 and will no longer be supported. Flex Consumption is now the " |
Related command
az functionapp
az functionapp create
Description
_params.py- Added a new functionapp argument context with a validator warn_linux_consumption_eol attached to the name argument to trigger EOL warnings on functionapp commands._validators.py- Added a new warn_linux_consumption_eol() function that:custom.py- Added warnings in create_functionapp():test_functionapp_commands.py- Fixed a test command from functionapp delete to functionapp plan delete -yTesting Guide
History Notes
[App Service]
az functionapp: Add warning for Linux consumption EOL and recommend migration to Flex consumption[App Service]
az functionapp create: Add warning for Linux consumption EOL and recommend using Flex consumptionThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.