Skip to content

{ManagedOps} Add Microsoft ManagedOps extension (az managedops) - #10157

Open
ugunarathna-ms wants to merge 10 commits into
Azure:mainfrom
ugunarathna-ms:feature-managedops
Open

{ManagedOps} Add Microsoft ManagedOps extension (az managedops)#10157
ugunarathna-ms wants to merge 10 commits into
Azure:mainfrom
ugunarathna-ms:feature-managedops

Conversation

@ugunarathna-ms

@ugunarathna-ms ugunarathna-ms commented Jul 29, 2026

Copy link
Copy Markdown

This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install azdev required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copilot AI review requested due to automatic review settings July 29, 2026 01:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces a new ManagedOps Azure CLI extension (az managedops) and wires it into the repository’s service/command mapping, including AAZ-generated command implementations and a scenario test with recordings.

Changes:

  • Added az managedops → Azure service mapping in src/service_name.json.
  • Added new src/managedops extension package scaffolding (setup metadata, README, HISTORY, azext metadata).
  • Added AAZ-generated commands and a live scenario test + recording for the managedops managedops command group.

Reviewed changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/service_name.json Registers the az managedops command mapping to its Azure service + documentation URL.
src/managedops/setup.py Extension packaging metadata (name/version/description/classifiers).
src/managedops/setup.cfg Extension packaging config file (currently placeholder).
src/managedops/README.md Extension README (currently contains placeholder usage text).
src/managedops/HISTORY.rst Extension changelog entry for initial beta release.
src/managedops/azext_managedops/init.py Command loader wiring for AAZ + (empty) imperative command table.
src/managedops/azext_managedops/_help.py Help module hook (imports helps dict).
src/managedops/azext_managedops/_params.py Argument loading hook (currently no custom arguments).
src/managedops/azext_managedops/azext_metadata.json Extension metadata (preview flag + min CLI core version).
src/managedops/azext_managedops/commands.py Imperative command table hook (currently empty).
src/managedops/azext_managedops/custom.py Custom module scaffold + logger (currently unused).
src/managedops/azext_managedops/aaz/init.py AAZ package scaffold.
src/managedops/azext_managedops/aaz/latest/init.py AAZ “latest” version scaffold.
src/managedops/azext_managedops/aaz/latest/managedops/init.py Imports the managedops AAZ command group.
src/managedops/azext_managedops/aaz/latest/managedops/__cmd_group.py Registers top-level az managedops command group.
src/managedops/azext_managedops/aaz/latest/managedops/managedops/init.py Imports the nested managedops managedops group + commands.
src/managedops/azext_managedops/aaz/latest/managedops/managedops/__cmd_group.py Registers az managedops managedops command group.
src/managedops/azext_managedops/aaz/latest/managedops/managedops/_create.py AAZ create (PUT) command implementation for the ManagedOps singleton.
src/managedops/azext_managedops/aaz/latest/managedops/managedops/_delete.py AAZ delete command implementation.
src/managedops/azext_managedops/aaz/latest/managedops/managedops/_show.py AAZ show (GET) command implementation.
src/managedops/azext_managedops/aaz/latest/managedops/managedops/_update.py AAZ update (GET+PUT) command implementation with generic update enabled.
src/managedops/azext_managedops/aaz/latest/managedops/managedops/_wait.py AAZ wait command implementation.
src/managedops/azext_managedops/tests/init.py Test package scaffold.
src/managedops/azext_managedops/tests/latest/init.py Latest test package scaffold.
src/managedops/azext_managedops/tests/latest/test_managedops.py Live scenario test for create/show/update/delete lifecycle.
src/managedops/azext_managedops/tests/latest/recordings/test_managedops_lifecycle.yaml Recorded HTTP interactions for scenario playback.
Comments suppressed due to low confidence (1)

src/managedops/azext_managedops/aaz/latest/managedops/managedops/_create.py:74

  • --log-analytics-workspace-id is not marked required, but the request builder sets logAnalyticsWorkspaceId as required. Mark this argument as required so the CLI fails fast with a clear validation error.
        _args_schema.log_analytics_workspace_id = AAZResourceIdArg(
            options=["--log-analytics-workspace-id"],
            arg_group="ChangeTrackingAndInventory",
            help="Log analytics workspace resource ID used by the service.",
        )

Comment thread src/managedops/HISTORY.rst Outdated
Comment thread src/managedops/setup.py
Comment thread src/managedops/README.md Outdated
Comment on lines +18 to +20
class __CMDGroup(AAZCommandGroup):
"""Manage Managedops
"""
Comment on lines +18 to +20
class __CMDGroup(AAZCommandGroup):
"""Manage Managedops
"""
Comment on lines +61 to +66
_args_schema.azure_monitor_workspace_id = AAZResourceIdArg(
options=["--azure-monitor-workspace-id"],
arg_group="AzureMonitorInsights",
help="Azure monitor workspace resource ID used by the service.",
)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The code was generated automatically from the API specs. Isn't this something to be fixed in the generation tool?

Comment on lines +93 to +98
_args_schema.user_assigned_managed_identity_id = AAZResourceIdArg(
options=["--user-assigned-managed-identity-id"],
arg_group="DesiredConfiguration",
help="User assigned Managed Identity used to perform operations on machines managed by Ops360.",
)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The code was generated automatically from the API specs. Isn't this something to be fixed in the generation tool?

Comment on lines +49 to +56
_args_schema.managed_ops_name = AAZStrArg(
options=["-n", "--name", "--managed-ops-name"],
help="Name of the resource.",
required=True,
fmt=AAZStrArgFormat(
pattern="default",
),
)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The code was generated automatically from the API specs. Isn't this something to be fixed in the generation tool?

@yonzhan

Copy link
Copy Markdown
Collaborator

ManagedOps

ugunarathna-ms and others added 3 commits July 29, 2026 12:44
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@x-engineering-agent

Copy link
Copy Markdown

Automated sensitive-information remediation ran on this pull request.

  • Detected categories: email address
  • Replaced with typed [REDACTED:category] placeholders in: no writable PR fields
  • Could not edit: file changes on a fork branch
  • Comment/review owners notified because Agent Assist cannot edit another user's text: none

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Keep the redaction · ❌ Dispute the redaction

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.


Posted by agent-assist (autonomous bug-fix pipeline).

@Pan-Qi Qi Pan (Pan-Qi) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please resolve conflict,thanks

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@ugunarathna-ms

Copy link
Copy Markdown
Author

Please resolve conflict,thanks

Resolved conflicts and all checks are passing now.

@ugunarathna-ms

Copy link
Copy Markdown
Author

Yabo Hu (@VeryEarly) / Qi Pan (@Pan-Qi) I have addressed comments. Can you please review? Thanks.

@x-engineering-agent

Copy link
Copy Markdown

Live test results — azdev test --live --series (changed test files only)

FAIL (exit 1)

Selectors: test_managedops (extension)
PR head ref: feature-managedops
PR head sha: 888fffee392996d9c6c867653fe11427ae1e4d5d
PR base ref: main
New test files in PR: true

Changed test files run
src/managedops/azext_managedops/tests/latest/test_managedops.py

New test files
src/managedops/azext_managedops/tests/latest/test_managedops.py

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/32346641835

Live-test recordings: 1 regenerated — archived in workflow artifact live-test-pr-10157 (recordings/).

ℹ️ This PR is from a fork, so recordings were not pushed automatically. Download them from the artifact and commit to your branch.

Recording files
src/managedops/azext_managedops/tests/latest/recordings/test_managedops_lifecycle.yaml
Last 80 lines of azdev output
                self.check("properties.provisioningState", "Succeeded"),
                self.check("properties.sku.name", "ManagedOps"),
                self.check("properties.sku.tier", "Essential"),
                self.check(
                    "properties.desiredConfiguration.azureMonitorInsights.azureMonitorWorkspaceId",
                    "{amw_id}",
                ),
                self.check(
                    "properties.desiredConfiguration.changeTrackingAndInventory.logAnalyticsWorkspaceId",
                    "{law_id}",
                ),
                self.check(
                    "properties.desiredConfiguration.userAssignedManagedIdentityId",
                    "{mi_id}",
                ),
                self.check("properties.desiredConfiguration.defenderCspm", "Disable"),
                self.check("properties.desiredConfiguration.defenderForServers", "Disable"),
            ],
        )

azure-cli-extensions/src/managedops/azext_managedops/tests/latest/test_managedops.py:81: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
azure-cli/src/azure-cli-testsdk/azure/cli/testsdk/base.py:177: in cmd
    return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
azure-cli/src/azure-cli-testsdk/azure/cli/testsdk/base.py:252: in __init__
    self._in_process_execute(cli_ctx, command, expect_failure=expect_failure)
azure-cli/src/azure-cli-testsdk/azure/cli/testsdk/base.py:315: in _in_process_execute
    raise ex.exception
.venv/lib/python3.12/site-packages/knack/cli.py:233: in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
azure-cli/src/azure-cli-core/azure/cli/core/commands/__init__.py:677: in execute
    raise ex
azure-cli/src/azure-cli-core/azure/cli/core/commands/__init__.py:820: in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
azure-cli/src/azure-cli-core/azure/cli/core/commands/__init__.py:800: in _run_job
    result = LongRunningOperation(cmd_copy.cli_ctx, 'Starting {}'.format(cmd_copy.name))(result)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
azure-cli/src/azure-cli-core/azure/cli/core/commands/__init__.py:1181: in __call__
    raise exception
azure-cli/src/azure-cli-core/azure/cli/core/commands/__init__.py:1168: in __call__
    result = poller.result()
             ^^^^^^^^^^^^^^^
azure-cli/src/azure-cli-core/azure/cli/core/aaz/_poller.py:105: in result
    self.wait(timeout)
.venv/lib/python3.12/site-packages/azure/core/tracing/decorator.py:119: in wrapper_use_tracer
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
azure-cli/src/azure-cli-core/azure/cli/core/aaz/_poller.py:127: in wait
    raise self._exception
azure-cli/src/azure-cli-core/azure/cli/core/aaz/_poller.py:80: in _start
    for polling_method in self._polling_generator:
                          ^^^^^^^^^^^^^^^^^^^^^^^
azure-cli-extensions/src/managedops/azext_managedops/aaz/latest/managedops/managedops/_create.py:127: in _execute_operations
    yield self.ManagedOpsCreateOrUpdate(ctx=self.ctx)()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
azure-cli-extensions/src/managedops/azext_managedops/aaz/latest/managedops/managedops/_create.py:167: in __call__
    return self.on_error(session.http_response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <azext_managedops.aaz.latest.managedops.managedops._create.Create.ManagedOpsCreateOrUpdate object at 0x7fc50ad0d130>
response = <RequestsTransportResponse: 404 Not Found, Content-Type: application/json>

    def on_error(self, response):
        """ handle errors in response
        """
        # raise common http errors
        error_type = self.error_map.get(response.status_code)
        if error_type:
>           raise error_type(response=response)
E           azure.core.exceptions.ResourceNotFoundError: (SubscriptionNotRegistered) The subscription 'f758ac53-3e63-4317-a956-0997793808d7' is not registered to 'Microsoft.ManagedOps'.
E           Code: SubscriptionNotRegistered
E           Message: The subscription 'f758ac53-3e63-4317-a956-0997793808d7' is not registered to 'Microsoft.ManagedOps'.

azure-cli/src/azure-cli-core/azure/cli/core/aaz/_operation.py:324: ResourceNotFoundError
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
============================== 1 failed in 51.20s ==============================

Posted by agent-assist live-test workflow.

@x-engineering-agent x-engineering-agent Bot 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.

❌ Live test failed

The upstream CI checks are green, but the live test run against the changed
test files did not pass. Please review the live-test run logs above for the
failure details and address them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

X Engineering Agent Reviewed Pull request reviewed by X Engineering Agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants