Skip to content

Add relationship CLI extension (Microsoft.Relationships)#9807

Merged
necusjz merged 5 commits intoAzure:mainfrom
meghanagupta95:feature/relationship
Apr 23, 2026
Merged

Add relationship CLI extension (Microsoft.Relationships)#9807
necusjz merged 5 commits intoAzure:mainfrom
meghanagupta95:feature/relationship

Conversation

@meghanagupta95
Copy link
Copy Markdown
Member

@meghanagupta95 meghanagupta95 commented Apr 21, 2026

Description

New Azure CLI extension for managing relationship resources (Microsoft.Relationships, API version 2023-09-01-preview).

Commands (6 total)

  • az relationship dependency-of create/show/delete
  • az relationship service-group-member create/show/delete

What are Relationships?

Relationships are ARM extension resources that create semantic associations between a source resource and a target resource:

  • dependencyOf — dependency links between ARM resources
  • serviceGroupMember — associates resources with Service Groups (target must be a Service Group)

Testing

  • 7 live tests: 4 CRUD scenarios + 3 error validation cases
  • All tests passing
  • azdev style PASSED, azdev linter PASSED
  • Target SG configurable via AZURE_RELATIONSHIP_TEST_TARGET_SG env var

Related

meghanagupta95 and others added 2 commits April 20, 2026 22:53
…review)

New extension with 6 commands across 2 subgroups:
- az relationship dependency-of create/show/delete
- az relationship service-group-member create/show/delete

AAZ commands generated via aaz-dev-tools from TypeSpec.
7 live tests: 4 CRUD scenarios + 3 error cases. All passing.
azdev style PASSED, azdev linter PASSED.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Developers can set AZURE_RELATIONSHIP_TEST_TARGET_SG to point to their
own pre-existing Service Group. Defaults to SDKTestsSG.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 21, 2026 03:03
@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

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

This PR introduces a new Azure CLI extension (relationship) for managing ARM extension resources under Microsoft.Relationships (2023-09-01-preview), exposing CRUD commands for dependencyOf and serviceGroupMember relationship types.

Changes:

  • Added extension packaging scaffold (setup/manifest/README/history + azext metadata).
  • Added AAZ-generated command implementation for relationship dependency-of and relationship service-group-member (create/show/delete).
  • Added live-only scenario tests covering CRUD flows and negative cases.

Reviewed changes

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

Show a summary per file
File Description
src/relationship/setup.py Extension packaging metadata for publishing/installing the relationship extension.
src/relationship/MANIFEST.in Ensures extension sources/metadata are included in the package.
src/relationship/README.md User-facing extension overview and command examples.
src/relationship/HISTORY.rst Changelog for extension releases.
src/relationship/azext_relationship/azext_metadata.json CLI core compatibility + preview flag.
src/relationship/azext_relationship/init.py Command loader wiring (loads AAZ command table + args).
src/relationship/azext_relationship/_help.py Help text for command groups and commands.
src/relationship/azext_relationship/_params.py Placeholder for argument customization hook.
src/relationship/azext_relationship/commands.py Placeholder for non-AAZ command table hook.
src/relationship/azext_relationship/custom.py Placeholder for custom (non-generated) operations.
src/relationship/azext_relationship/aaz/init.py AAZ package root for generated commands.
src/relationship/azext_relationship/aaz/latest/init.py AAZ “latest” version namespace marker.
src/relationship/azext_relationship/aaz/latest/relationship/init.py Registers top-level relationship command group.
src/relationship/azext_relationship/aaz/latest/relationship/__cmd_group.py AAZ command-group registration for relationship.
src/relationship/azext_relationship/aaz/latest/relationship/dependency_of/init.py Registers relationship dependency-of subgroup and commands.
src/relationship/azext_relationship/aaz/latest/relationship/dependency_of/__cmd_group.py AAZ command-group registration for relationship dependency-of.
src/relationship/azext_relationship/aaz/latest/relationship/dependency_of/_create.py AAZ implementation for relationship dependency-of create.
src/relationship/azext_relationship/aaz/latest/relationship/dependency_of/_show.py AAZ implementation for relationship dependency-of show.
src/relationship/azext_relationship/aaz/latest/relationship/dependency_of/_delete.py AAZ implementation for relationship dependency-of delete.
src/relationship/azext_relationship/aaz/latest/relationship/service_group_member/init.py Registers relationship service-group-member subgroup and commands.
src/relationship/azext_relationship/aaz/latest/relationship/service_group_member/__cmd_group.py AAZ command-group registration for relationship service-group-member.
src/relationship/azext_relationship/aaz/latest/relationship/service_group_member/_create.py AAZ implementation for relationship service-group-member create.
src/relationship/azext_relationship/aaz/latest/relationship/service_group_member/_show.py AAZ implementation for relationship service-group-member show.
src/relationship/azext_relationship/aaz/latest/relationship/service_group_member/_delete.py AAZ implementation for relationship service-group-member delete.
src/relationship/azext_relationship/tests/init.py Test package marker.
src/relationship/azext_relationship/tests/latest/init.py Latest test namespace marker.
src/relationship/azext_relationship/tests/latest/test_relationship_scenario.py Live-only scenario coverage for CRUD + negative validation cases.

Comment thread src/relationship/setup.py
Comment thread src/relationship/HISTORY.rst Outdated
Comment thread src/relationship/azext_relationship/tests/latest/test_relationship_scenario.py Outdated
The CI linter cannot resolve help examples from _help.py during
diff-based checks. Add missing_command_example exclusions for the
two create commands that already have examples defined in _help.py.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- setup.py: Add long_description_content_type='text/markdown'
- HISTORY.rst: Fix RST underline length for 1.0.0b1
- dependency_of/service_group_member _create.py: Mark --target-id as required
- test_relationship_scenario.py: Skip tests when AZURE_RELATIONSHIP_TEST_TARGET_SG
  is not set instead of using a hard-coded default

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@yonzhan yonzhan requested a review from necusjz April 21, 2026 05:08
@yonzhan yonzhan removed the request for review from kairu-ms April 21, 2026 05:08
@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).

…tension

The CI pipeline's service_name.check() requires every extension's top-level
command group to have an entry in src/service_name.json. The 'relationship'
entry was missing, causing the azdev linter and azdev style CI jobs to fail.

Also adds the conventional setup.cfg with [bdist_wheel] universal=1, which
196 out of 200 extensions in the repo include.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@meghanagupta95
Copy link
Copy Markdown
Member Author

Hi @necusjz could you help run the pipeline again? Also, is it possible to get write access to this repo so that I don't have to wait for someone else to run it?

@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 necusjz merged commit 6fc7841 into Azure:main Apr 23, 2026
24 checks passed
@azclibot
Copy link
Copy Markdown
Collaborator

[Release] Update index.json for extension [ relationship-1.0.0b1 ] : https://dev.azure.com/msazure/One/_build/results?buildId=161470336&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