[AZINTS-4618] CAJ migration script entrypoint - #229
Conversation
| raise InputParamValidationError("Failed parse --control-plane-ids") | ||
|
|
||
| validate_az_cli() | ||
| # TODO add other user validation? |
There was a problem hiding this comment.
For a follow up PR
There was a problem hiding this comment.
Pull request overview
This PR refactors Azure logging_install control-plane task metadata to live on ControlPlane, adds subscription scoping to Container App environment existence checks/creation, and introduces a new azure/lfo_container_app_migration package to orchestrate migration steps from Function Apps to Container App Jobs.
Changes:
- Move task names/images list from
ConfigurationtoControlPlane(task_names,*_task_image) and update call sites/tests accordingly. - Ensure
containerapp env show/createand other “verify exists” checks are executed with an explicit--subscription. - Add initial migration framework (
run_steps, prompts, CLI entrypoint) for Function App → Container App Jobs migration.
Reviewed changes
Copilot reviewed 15 out of 19 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| azure/logging_install/tests/test_resource_setup.py | Updates tests for new task-name locations and new env creation signature (adds subscription). |
| azure/logging_install/tests/test_main.py | Updates tests to reference control_plane.task_names. |
| azure/logging_install/tests/test_deploy.py | Updates deploy tests for new env creation signature (adds subscription). |
| azure/logging_install/tests/test_data.py | Adjusts test config to set control_plane.task_names. |
| azure/logging_install/tests/test_configuration.py | Updates assertions for moved task-name properties. |
| azure/logging_install/src/azure_logging_install/resource_setup.py | Adds verify_*_exists helpers and threads subscription through Container App env checks/creation. |
| azure/logging_install/src/azure_logging_install/existing_lfo.py | Refactors control-plane discovery; adds get_current_config_for_control_plane and type-filtered discovery. |
| azure/logging_install/src/azure_logging_install/deploy.py | Passes subscription into create_container_app_environment. |
| azure/logging_install/src/azure_logging_install/configuration.py | Moves task name/image derivation onto ControlPlane. |
| azure/lfo_container_app_migration/tests/test_steps.py | Adds unit tests for step execution/rollback behavior. |
| azure/lfo_container_app_migration/src/azure_lfo_container_app_migration/steps.py | Implements step runner with rollback-on-failure semantics. |
| azure/lfo_container_app_migration/src/azure_lfo_container_app_migration/prompts.py | Adds a simple yes/no confirmation prompt. |
| azure/lfo_container_app_migration/src/azure_lfo_container_app_migration/migration.py | Adds migration discovery loop and installation verification hooks. |
| azure/lfo_container_app_migration/src/azure_lfo_container_app_migration/main.py | Adds CLI entrypoint and arg parsing for selecting control planes + log level. |
| azure/lfo_container_app_migration/pytest.ini | Configures pytest import paths for the new package. |
| azure/lfo_container_app_migration/src/azure_lfo_container_app_migration/init.py | Package marker. |
Suppressed comments (1)
azure/logging_install/tests/test_data.py:64
get_test_config()uses a shallow copy ofTEST_CONFIG, then mutatestest_config.control_plane.task_names. Because theControlPlaneinstance is shared across shallow copies, this can leak mutations between tests (contradicting the function docstring). Use a deep copy (or clone thecontrol_plane) before mutating nested state.
"""Return a copy of TEST_CONFIG so test mutations do not affect other tests."""
test_config = copy.copy(TEST_CONFIG)
test_config.control_plane.task_names = [
RESOURCE_TASK_NAME,
SCALING_TASK_NAME,
DIAGNOSTIC_SETTINGS_TASK_NAME,
]
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if len(control_planes) <= 0: | ||
| return [] |
There was a problem hiding this comment.
I think this was a bug. If an environment has one LFO installation but that LFO has an empty MONITORED_SUBSCRIPTIONS env var, it would be ignored and the customer would be prompted to set up another one.
| # Control plane tasks | ||
| self.resources_task_name = _get_resources_task_name(self.control_plane.id) |
There was a problem hiding this comment.
Missed removing some of these in a previous PR
tests
Unit tests.
Ran the logging_install script. Detection of existing LFOs still works:

Installing new LFO still works
