Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/azure-cli/azure/cli/command_modules/appservice/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,33 @@
short-summary: List available built-in stacks which can be used for function apps on the Flex Consumption plan.
"""

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

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.
examples:
- name: Migrate a Linux Consumption function app to the Flex Consumption plan.
text: >
az functionapp flex-migration start --source-name MyLinuxConsumptionApp --source-resource-group MyLinuxConsumptionResourceGroup --name MyFunctionApp --resource-group MyResourceGroup --storage-account MyStorageAccount
Comment thread
kamperiadis marked this conversation as resolved.

- 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
"""

helps['functionapp flex-migration list'] = """
type: command
short-summary: List all Linux Consumption function apps that are eligible for migration to the Flex Consumption plan.
examples:
- name: List all Linux Consumption function apps that are eligible for migration to the Flex Consumption plan.
text: >
az functionapp flex-migration list
"""

helps['functionapp plan'] = """
type: group
short-summary: Manage App Service Plans for an Azure Function
Expand Down
13 changes: 13 additions & 0 deletions src/azure-cli/azure/cli/command_modules/appservice/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,19 @@ def load_arguments(self, _):
help='Include the runtime details of the regions.', is_preview=True)
c.argument('runtime', help="limit the output to just the specified runtime", is_preview=True)

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('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('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('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 @@ -345,6 +345,10 @@ def load_command_table(self, _):
custom_func_name='update_functionapp', getter_type=appservice_custom, setter_type=appservice_custom, command_type=webapp_sdk,
validator=validate_functionapp_on_containerapp_update)

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('list', 'list_flex_migration_candidates', exception_handler=ex_handler_factory())

with self.command_group('functionapp deployment config') as g:
g.custom_command('set', 'update_deployment_configs', exception_handler=ex_handler_factory(), validator=validate_is_flex_functionapp)
g.custom_show_command('show', 'get_deployment_configs', exception_handler=ex_handler_factory(), validator=validate_is_flex_functionapp)
Expand Down
Loading
Loading