Skip to content

[AZINTS-4618] CAJ migration script entrypoint - #229

Merged
parsons90 merged 17 commits into
mainfrom
rebecca.parsons/AZINTS-4618/caj_migration_script_1
Sep 9, 2026
Merged

[AZINTS-4618] CAJ migration script entrypoint#229
parsons90 merged 17 commits into
mainfrom
rebecca.parsons/AZINTS-4618/caj_migration_script_1

Conversation

@parsons90

@parsons90 parsons90 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor
  1. Add CLI entrypoint for the script
  2. Query existing Function App LFOs
  3. Add basic validation of existing Function App LFOs. More validation to come later
  4. Create framework for executing and rolling back steps of the migration.

tests

Unit tests.

Ran the logging_install script. Detection of existing LFOs still works:
Screenshot 2026-08-11 at 10 03 44 PM

Installing new LFO still works
Screenshot 2026-08-11 at 10 15 01 PM

raise InputParamValidationError("Failed parse --control-plane-ids")

validate_az_cli()
# TODO add other user validation?

@parsons90 parsons90 Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a follow up PR

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Configuration to ControlPlane (task_names, *_task_image) and update call sites/tests accordingly.
  • Ensure containerapp env show/create and 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 of TEST_CONFIG, then mutates test_config.control_plane.task_names. Because the ControlPlane instance is shared across shallow copies, this can leak mutations between tests (contradicting the function docstring). Use a deep copy (or clone the control_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.

Comment thread azure/lfo_container_app_migration/src/azure_lfo_container_app_migration/main.py Outdated
Comment thread azure/logging_install/src/azure_logging_install/existing_lfo.py Outdated
Comment thread azure/logging_install/src/azure_logging_install/resource_setup.py
Comment thread azure/logging_install/src/azure_logging_install/resource_setup.py
@parsons90 parsons90 changed the title Rebecca.parsons/azints 4618/caj migration script 1 [AZINTS-4618] CAJ migration script entrypoint Aug 11, 2026
Comment on lines -117 to -118
if len(control_planes) <= 0:
return []

@parsons90 parsons90 Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines -73 to -74
# Control plane tasks
self.resources_task_name = _get_resources_task_name(self.control_plane.id)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed removing some of these in a previous PR

@parsons90
parsons90 marked this pull request as ready for review August 12, 2026 13:53
@parsons90
parsons90 requested a review from a team as a code owner August 12, 2026 13:53
@parsons90
parsons90 requested a review from benblaustein August 12, 2026 13:53
@parsons90
parsons90 merged commit abefda1 into main Sep 9, 2026
12 of 13 checks passed
@parsons90
parsons90 deleted the rebecca.parsons/AZINTS-4618/caj_migration_script_1 branch September 9, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants