Skip to content
19 changes: 16 additions & 3 deletions src/azure-cli/azure/cli/command_modules/appservice/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -1216,20 +1216,33 @@

helps['functionapp flex-migration'] = """
type: group
short-summary: Manage migration of Linux Consumption function apps to the Flex Consumption plan.
short-summary: Manage migration between Linux Consumption and Flex Consumption plans.
"""

helps['functionapp flex-migration start'] = """
type: command
short-summary: Create a Flex Consumption app with the same settings as the provided Linux Consumption function app.
short-summary: Migrate a Linux Consumption function app to Flex Consumption. Supports side-by-side (new app) or in-place (same app) upgrade.
examples:
- name: Migrate a Linux Consumption function app to the Flex Consumption plan.
- name: Migrate a Linux Consumption function app to the Flex Consumption plan (side-by-side, creates a new app).
text: >
az functionapp flex-migration start --source-name MyLinuxConsumptionApp --source-resource-group MyLinuxConsumptionResourceGroup --name MyFunctionApp --resource-group MyResourceGroup --storage-account MyStorageAccount

- name: Migrate a Linux Consumption function app to the Flex Consumption plan without migrating managed identity configurations.
text: >
az functionapp flex-migration start --source-name MyLinuxConsumptionApp --source-resource-group MyLinuxConsumptionResourceGroup --name MyFunctionApp --resource-group MyResourceGroup --storage-account MyStorageAccount --skip-managed-identities

- name: Upgrade a Linux Consumption function app to Flex Consumption in place (same app, same name).
text: >
az functionapp flex-migration start --source-name MyLinuxConsumptionApp --source-resource-group MyLinuxConsumptionResourceGroup --in-place
"""

helps['functionapp flex-migration revert'] = """
type: command
short-summary: Revert an in-place upgraded Flex Consumption function app to Linux Consumption.
examples:
- name: Revert a function app to Linux Consumption within its revert window.
text: >
az functionapp flex-migration revert --source-name MyFunctionApp --source-resource-group MyResourceGroup
"""

helps['functionapp flex-migration list'] = """
Expand Down
17 changes: 15 additions & 2 deletions src/azure-cli/azure/cli/command_modules/appservice/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,16 +439,29 @@ def load_arguments(self, _):
with self.argument_context('functionapp flex-migration start') as c:
c.argument('source_resource_group', help='The resource group of the source function app to migrate from.')
c.argument('source_name', help='The name of the source function app to migrate from.')
c.argument('resource_group', help='The resource group of the target function app to migrate to.')
c.argument('name', help='The name of the target function app to migrate to.')
c.argument('resource_group', help='The resource group of the target function app to migrate to. Not applicable with --in-place.')
c.argument('name', help='The name of the target function app to migrate to. Not applicable with --in-place.')
c.argument('storage_account', help='The storage account to use for the target function app. If no storage account is provided, the storage account of the source function app will be used.')
c.argument('maximum_instance_count', type=int, help="The maximum number of instances.")
c.argument('in_place', options_list=['--in-place', '-i'], arg_type=get_three_state_flag(), help="Upgrade the source app to Flex Consumption in place (same app, same name, same hostname). Cannot be used with --name or --resource-group.", is_preview=True)
c.argument('instance_memory', type=int, help="The instance memory size in MB. See https://aka.ms/flex-instance-sizes for more information on the supported values.")
c.argument('always_ready_instances', nargs='+', help="space-separated configuration for the number of pre-allocated instances in the format `<name>=<value>`")
c.argument('deployment_storage_name', options_list=['--deployment-storage-name', '--dsn'], help="The deployment storage account name.")
c.argument('deployment_storage_container_name', options_list=['--deployment-storage-container-name', '--dscn'], help="The deployment storage account container name.")
c.argument('deployment_storage_auth_type', options_list=['--deployment-storage-auth-type', '--dsat'], arg_type=get_enum_type(DEPLOYMENT_STORAGE_AUTH_TYPES), help="The deployment storage account authentication type.")
c.argument('deployment_storage_auth_value', options_list=['--deployment-storage-auth-value', '--dsav'], help="The deployment storage account authentication value. For the user-assigned managed identity authentication type, "
"this should be the user assigned identity resource id. For the storage account connection string authentication type, this should be the name of the app setting that will contain the storage account connection "
"string. For the system assigned managed-identity authentication type, this parameter is not applicable and should be left empty.")
c.argument('skip_managed_identities', options_list=['--skip-managed-identities', '--smi'], arg_type=get_three_state_flag(return_label=True), help="Skip migrating managed identities.")
c.argument('skip_access_restrictions', options_list=['--skip-access-restrictions', '--sar'], arg_type=get_three_state_flag(return_label=True), help="Skip migrating access restrictions.")
c.argument('skip_storage_mount', options_list=['--skip-storage-mount', '--ssm'], arg_type=get_three_state_flag(return_label=True), help="Skip migrating storage mounts.")
c.argument('skip_hostnames', options_list=['--skip-hostnames', '--sh'], arg_type=get_three_state_flag(return_label=True), help="Skip migrating hostnames.")
c.argument('skip_cors', options_list=['--skip-cors', '--sc'], arg_type=get_three_state_flag(return_label=True), help="Skip migrating CORS settings.")

with self.argument_context('functionapp flex-migration revert') as c:
c.argument('source_resource_group', help='The resource group of the function app to revert.')
c.argument('source_name', help='The name of the function app to revert.')

with self.argument_context('webapp deleted list') as c:
c.argument('name', arg_type=webapp_name_arg_type, id_part=None)
c.argument('slot', options_list=['--slot', '-s'], help='Name of the deleted web app slot.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ def load_command_table(self, _):

with self.command_group('functionapp flex-migration') as g:
g.custom_command('start', 'migrate_consumption_to_flex', exception_handler=ex_handler_factory())
g.custom_command('revert', 'revert_flex_migration', exception_handler=ex_handler_factory(), is_preview=True)
g.custom_command('list', 'list_flex_migration_candidates', exception_handler=ex_handler_factory())

with self.command_group('functionapp deployment config') as g:
Expand Down
Loading
Loading