Skip to content

New extension: servicegroup (Microsoft.Management/serviceGroups preview)#9805

Merged
necusjz merged 10 commits into
Azure:mainfrom
meghanagupta95:feature/service-group
Apr 28, 2026
Merged

New extension: servicegroup (Microsoft.Management/serviceGroups preview)#9805
necusjz merged 10 commits into
Azure:mainfrom
meghanagupta95:feature/service-group

Conversation

@meghanagupta95
Copy link
Copy Markdown
Member

Description

Add new servicegroup CLI extension for managing Azure Service Groups (Microsoft.Management/serviceGroups), a tenant-scoped ARM resource in public preview (API version 2024-02-01-preview).

Commands Added

Command Description
az service-group create Create a service group (PUT LRO)
az service-group show Get a service group
az service-group update Update a service group (PATCH LRO)
az service-group delete Delete a service group (DELETE LRO)
az service-group list-ancestors List ancestors of a service group (POST action)

Implementation Details

  • Pattern: AAZ (Atomic Azure CLI) — no SDK dependency, REST calls built into command files
  • Scope: Tenant-level resource (no subscription/resource-group parameters)
  • Code generation: Generated via aaz-dev-tools from TypeSpec (Microsoft.Management/ServiceGroups)
  • API version: 2024-02-01-preview
  • Extension version: 0.1.0 (isPreview: true)

Testing

  • 3 scenario tests covering full CRUD, list-ancestors with hierarchy, and nested parent creation
  • All 3 tests pass live against production API
  • azdev style servicegroup — Pylint PASSED, Flake8 PASSED
  • azdev linter --include-whl-extensions servicegroup — All rules PASSED

Related PRs

  • aaz command models: Azure/aaz (to be submitted separately)

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

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run azdev linter --include-whl-extensions <YOUR_EXT> locally?
  • Have you run azdev test <YOUR_EXT> (with --live) locally?

Copilot AI review requested due to automatic review settings April 21, 2026 01:11
@azure-client-tools-bot-prd
Copy link
Copy Markdown

Validation for Breaking Change Starting...

Thanks for your contribution!

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 21, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown
Contributor

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@github-actions
Copy link
Copy Markdown
Contributor

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

@github-actions github-actions Bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Apr 21, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new servicegroup Azure CLI extension (AAZ-generated, REST-based) to manage tenant-scoped Azure Service Groups (Microsoft.Management/serviceGroups, 2024-02-01-preview) including CRUD operations and an ancestors action.

Changes:

  • Introduces AAZ command group az service-group with create/show/update/delete and list-ancestors.
  • Adds extension packaging scaffolding (setup, manifest, metadata, readme/history).
  • Adds live-only scenario tests covering CRUD and hierarchy behavior.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/servicegroup/setup.py Adds extension packaging metadata for distribution.
src/servicegroup/setup.cfg Adds packaging config file (currently empty placeholder).
src/servicegroup/MANIFEST.in Ensures README/history/metadata and Python sources are included in the package.
src/servicegroup/README.md Documents extension purpose and basic command usage.
src/servicegroup/HISTORY.rst Adds initial release history entry.
src/servicegroup/azext_servicegroup/azext_metadata.json Declares preview status and minimum CLI core version.
src/servicegroup/azext_servicegroup/init.py Registers the command loader and hooks AAZ command table loading.
src/servicegroup/azext_servicegroup/_help.py Adds CLI help content for the new command group and commands.
src/servicegroup/azext_servicegroup/_params.py Adds argument loading hook (currently no-op).
src/servicegroup/azext_servicegroup/commands.py Adds command table loading hook (currently no-op; AAZ handles commands).
src/servicegroup/azext_servicegroup/custom.py Adds custom module scaffolding (logger).
src/servicegroup/azext_servicegroup/aaz/init.py Exposes AAZ package namespace.
src/servicegroup/azext_servicegroup/aaz/latest/init.py Wires latest AAZ command module import.
src/servicegroup/azext_servicegroup/aaz/latest/service_group/__cmd_group.py Registers the service-group command group as preview.
src/servicegroup/azext_servicegroup/aaz/latest/service_group/init.py Exports AAZ command implementations for the group.
src/servicegroup/azext_servicegroup/aaz/latest/service_group/_create.py Implements az service-group create (PUT LRO).
src/servicegroup/azext_servicegroup/aaz/latest/service_group/_show.py Implements az service-group show (GET).
src/servicegroup/azext_servicegroup/aaz/latest/service_group/_update.py Implements az service-group update (PATCH LRO).
src/servicegroup/azext_servicegroup/aaz/latest/service_group/_delete.py Implements az service-group delete (DELETE LRO + confirmation).
src/servicegroup/azext_servicegroup/aaz/latest/service_group/_list_ancestors.py Implements az service-group list-ancestors (POST action).
src/servicegroup/azext_servicegroup/tests/init.py Adds tests package marker.
src/servicegroup/azext_servicegroup/tests/latest/init.py Adds latest tests package marker.
src/servicegroup/azext_servicegroup/tests/latest/test_servicegroup_scenario.py Adds live-only scenario tests for CRUD and ancestor listing.

Comment thread src/servicegroup/setup.cfg Outdated
Comment thread src/servicegroup/README.md Outdated
Comment thread src/servicegroup/azext_servicegroup/_help.py
Comment thread src/servicegroup/azext_servicegroup/aaz/latest/service_group/_create.py Outdated
@github-actions github-actions Bot removed the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Apr 21, 2026
@meghanagupta95
Copy link
Copy Markdown
Member Author

Thanks @yonzhan. Could you help run the remaining validation pipeline?

@yonzhan yonzhan requested a review from necusjz April 21, 2026 03:04
@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 21, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@necusjz
Copy link
Copy Markdown
Member

necusjz commented Apr 21, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@meghanagupta95 meghanagupta95 force-pushed the feature/service-group branch from c041bdf to ff748a5 Compare April 21, 2026 19:10
@meghanagupta95
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 9805 in repo Azure/azure-cli-extensions

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 21, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@meghanagupta95
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 9805 in repo Azure/azure-cli-extensions

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 22, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@meghanagupta95 meghanagupta95 force-pushed the feature/service-group branch from 843b1cc to 6dc17ba Compare April 22, 2026 12:23
@meghanagupta95
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 9805 in repo Azure/azure-cli-extensions

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 22, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

Comment thread src/servicegroup/setup.py
necusjz pushed a commit to Azure/aaz that referenced this pull request Apr 23, 2026
…2024-02-01-preview)

Register AAZ command models for the new service-group CLI extension:
- service-group create (PUT LRO)
- service-group show (GET)
- service-group update (PATCH LRO)
- service-group delete (DELETE LRO)
- service-group list-ancestors (POST action)

Related CLI extension PR: Azure/azure-cli-extensions#9805

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
meghanagupta95 and others added 10 commits April 23, 2026 09:24
…eview)

Add new CLI extension for managing Azure Service Groups, a tenant-scoped
resource for organizing resources, resource groups, and subscriptions into
hierarchical service groups.

Commands:
- az service-group create: Create or update a service group (PUT LRO)
- az service-group show: Get details of a service group
- az service-group update: Update a service group (PATCH LRO)
- az service-group delete: Delete a service group (DELETE LRO)
- az service-group list-ancestors: List ancestors of a service group (POST)

API: Microsoft.Management/serviceGroups 2024-02-01-preview
Scope: Tenant-level (no subscription/resource group)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Regenerated aaz/ command files using aaz-dev-tools from TypeSpec-compiled swagger
- Updated delete command confirmation message
- Fixed test assertions to use flattened property paths (client_flatten=True)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- All creates now include --parent pointing to root SG (tenantId)
- Root SG auto-creates when referenced as parent per API contract
- Changed @record_only to @live_only for initial development
- CRUD test: create/show/update(with tags)/delete + verify 404 after delete
- list-ancestors test: 3-level hierarchy, verify child and parent in ancestors
- nested-parent test: root -> parent -> child, verify parent references

All 3 tests pass live (91s).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- All create examples now include --parent (required by API contract)
- Made --parent resource-id required in _create.py arg schema
- Removed empty setup.cfg
- README, _help.py, and _create.py docstring updated consistently

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Change pattern strings from regular strings to raw strings (r'...')
to fix SyntaxWarning for invalid escape sequence '\-' in Python 3.12+.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add AAZWaitCommand to satisfy require_wait_command_if_no_wait linter
rule since create/update/delete expose --no-wait.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@meghanagupta95 meghanagupta95 force-pushed the feature/service-group branch from 6dc17ba to c99fef0 Compare April 23, 2026 13:24
@meghanagupta95
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 9805 in repo Azure/azure-cli-extensions

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 23, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@meghanagupta95
Copy link
Copy Markdown
Member Author

Hi @necusjz, would it be possible to have this extension merged and published by this week's end?

@meghanagupta95
Copy link
Copy Markdown
Member Author

Hi @necusjz @yonzhan could you provide an update, if possible?

@necusjz necusjz merged commit ead5208 into Azure:main Apr 28, 2026
24 checks passed
@azclibot
Copy link
Copy Markdown
Collaborator

[Release] Update index.json for extension [ servicegroup-1.0.0b1 ] : https://dev.azure.com/msazure/One/_build/results?buildId=162029902&view=results

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants