Skip to content

Planetary Computer CLI extension#9737

Open
thisisdevanshu wants to merge 3 commits intoAzure:mainfrom
thisisdevanshu:add-planetarycomputer-extension
Open

Planetary Computer CLI extension#9737
thisisdevanshu wants to merge 3 commits intoAzure:mainfrom
thisisdevanshu:add-planetarycomputer-extension

Conversation

@thisisdevanshu
Copy link
Copy Markdown
Member


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 wheel==0.30.0 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.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Validation for Breaking Change Starting...

Thanks for your contribution!

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @thisisdevanshu,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@thisisdevanshu thisisdevanshu force-pushed the add-planetarycomputer-extension branch from db78d69 to 1e77591 Compare March 28, 2026 00:15
@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Mar 28, 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

- AAZ-based extension for Microsoft.Orbital/geoCatalogs (API version 2026-04-15)
- Commands: planetarycomputer geocatalog create/show/list/update/delete/wait
- Identity commands: geocatalog identity assign/show/remove/wait
- Short alias --scope for --auto-generated-domain-name-label-scope
- Command examples for create, update, and identity assign
- Help text for all command groups
- 10 scenario tests with playback recordings
- Version 1.0.0b1 (preview)
@thisisdevanshu thisisdevanshu force-pushed the add-planetarycomputer-extension branch from 3efdc0f to ad26d3e Compare March 28, 2026 02:11
@thisisdevanshu thisisdevanshu marked this pull request as ready for review April 1, 2026 00:14
Copilot AI review requested due to automatic review settings April 1, 2026 00:14
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

Introduces a new Azure CLI extension (planetarycomputer) for managing Planetary Computer GeoCatalog resources, including AAZ-generated command implementations and scenario tests with VCR recordings.

Changes:

  • Adds extension packaging metadata and documentation (setup files, README, history).
  • Adds AAZ-generated command groups/commands for GeoCatalog CRUD, identity management, and wait operations.
  • Adds ScenarioTest coverage with recordings for the new commands.

Reviewed changes

Copilot reviewed 38 out of 41 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/planetarycomputer/setup.py Adds packaging metadata and setuptools configuration for the new extension.
src/planetarycomputer/setup.cfg Adds placeholder setup.cfg file (repo-standard pattern).
src/planetarycomputer/README.md Adds user-facing usage docs and command examples for the extension.
src/planetarycomputer/HISTORY.rst Adds initial release notes for version 1.0.0b1.
src/planetarycomputer/azext_planetarycomputer/init.py Registers the extension command loader and wires AAZ command table loading.
src/planetarycomputer/azext_planetarycomputer/_help.py Defines CLI help entries for command groups and key commands.
src/planetarycomputer/azext_planetarycomputer/_params.py Stub for non-AAZ argument loading (currently no custom args).
src/planetarycomputer/azext_planetarycomputer/commands.py Stub for non-AAZ command table loading (AAZ is the primary command source).
src/planetarycomputer/azext_planetarycomputer/custom.py Placeholder module for future customizations (currently logger only).
src/planetarycomputer/azext_planetarycomputer/azext_metadata.json Declares extension preview status and minimum CLI core version.
src/planetarycomputer/azext_planetarycomputer/aaz/init.py Initializes the AAZ package for the extension.
src/planetarycomputer/azext_planetarycomputer/aaz/latest/init.py Initializes the latest AAZ profile package.
src/planetarycomputer/azext_planetarycomputer/aaz/latest/spatio/init.py Initializes the top-level AAZ command group package.
src/planetarycomputer/azext_planetarycomputer/aaz/latest/spatio/__cmd_group.py Defines the top-level AAZ command group registration for planetarycomputer.
src/planetarycomputer/azext_planetarycomputer/aaz/latest/spatio/geo_catalog/init.py Exposes GeoCatalog commands in the AAZ module.
src/planetarycomputer/azext_planetarycomputer/aaz/latest/spatio/geo_catalog/__cmd_group.py Registers the planetarycomputer geocatalog command group.
src/planetarycomputer/azext_planetarycomputer/aaz/latest/spatio/geo_catalog/_create.py Implements az planetarycomputer geocatalog create (AAZ).
src/planetarycomputer/azext_planetarycomputer/aaz/latest/spatio/geo_catalog/_delete.py Implements az planetarycomputer geocatalog delete (AAZ).
src/planetarycomputer/azext_planetarycomputer/aaz/latest/spatio/geo_catalog/_list.py Implements az planetarycomputer geocatalog list with paging (AAZ).
src/planetarycomputer/azext_planetarycomputer/aaz/latest/spatio/geo_catalog/_show.py Implements az planetarycomputer geocatalog show (AAZ).
src/planetarycomputer/azext_planetarycomputer/aaz/latest/spatio/geo_catalog/_update.py Implements az planetarycomputer geocatalog update incl. generic update (AAZ).
src/planetarycomputer/azext_planetarycomputer/aaz/latest/spatio/geo_catalog/_wait.py Implements az planetarycomputer geocatalog wait (AAZ).
src/planetarycomputer/azext_planetarycomputer/aaz/latest/spatio/geo_catalog/identity/init.py Exposes GeoCatalog identity subcommands in the AAZ module.
src/planetarycomputer/azext_planetarycomputer/aaz/latest/spatio/geo_catalog/identity/__cmd_group.py Registers the planetarycomputer geocatalog identity command group.
src/planetarycomputer/azext_planetarycomputer/aaz/latest/spatio/geo_catalog/identity/_assign.py Implements az planetarycomputer geocatalog identity assign (AAZ).
src/planetarycomputer/azext_planetarycomputer/aaz/latest/spatio/geo_catalog/identity/_remove.py Implements az planetarycomputer geocatalog identity remove (AAZ).
src/planetarycomputer/azext_planetarycomputer/aaz/latest/spatio/geo_catalog/identity/_show.py Implements az planetarycomputer geocatalog identity show (AAZ).
src/planetarycomputer/azext_planetarycomputer/aaz/latest/spatio/geo_catalog/identity/_wait.py Implements az planetarycomputer geocatalog identity wait (AAZ).
src/planetarycomputer/azext_planetarycomputer/tests/init.py Initializes the tests package.
src/planetarycomputer/azext_planetarycomputer/tests/latest/init.py Initializes the latest tests package.
src/planetarycomputer/azext_planetarycomputer/tests/latest/test_planetarycomputer.py Adds scenario tests for GeoCatalog and identity workflows.
src/planetarycomputer/azext_planetarycomputer/tests/latest/recordings/test_geocatalog_show.yaml Adds VCR recording for geocatalog show.
src/planetarycomputer/azext_planetarycomputer/tests/latest/recordings/test_geocatalog_list_by_resource_group.yaml Adds VCR recording for geocatalog list -g.
src/planetarycomputer/azext_planetarycomputer/tests/latest/recordings/test_geocatalog_list_by_subscription.yaml Adds VCR recording for geocatalog list (subscription scope).
src/planetarycomputer/azext_planetarycomputer/tests/latest/recordings/test_geocatalog_update_tags.yaml Adds VCR recording for geocatalog update --tags (including clearing tags).
src/planetarycomputer/azext_planetarycomputer/tests/latest/recordings/test_geocatalog_wait.yaml Adds VCR recording for geocatalog wait.
src/planetarycomputer/azext_planetarycomputer/tests/latest/recordings/test_geocatalog_identity_assign_user.yaml Adds VCR recording for identity assign and subsequent identity show.
src/planetarycomputer/azext_planetarycomputer/tests/latest/recordings/test_geocatalog_identity_remove_user.yaml Adds VCR recording for identity remove flow.
src/planetarycomputer/azext_planetarycomputer/tests/latest/recordings/test_geocatalog_crud.yaml Adds VCR recording for create/show/list/update/delete end-to-end CRUD.
src/planetarycomputer/azext_planetarycomputer/tests/latest/recordings/test_geocatalog_create_with_options.yaml Adds VCR recording for create with explicit options and identity.
src/planetarycomputer/azext_planetarycomputer/tests/latest/recordings/test_geocatalog_create_and_delete_no_wait.yaml Adds VCR recording for --no-wait create/delete + wait assertions.

@@ -0,0 +1,47 @@
# Azure CLI Planetarycomputer Extension #
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The extension name is written as "Planetarycomputer" here, but elsewhere in this extension (e.g., CLI help summaries) it’s spelled "Planetary Computer". Please make the README title/intro consistent with the product name used in help text to avoid confusing users.

Suggested change
# Azure CLI Planetarycomputer Extension #
# Azure CLI Planetary Computer Extension #

Copilot uses AI. Check for mistakes.
Comment on lines +39 to +42
name='planetarycomputer',
version=VERSION,
description='Microsoft Azure Command-Line Tools Planetarycomputer Extension.',
long_description=README + '\n\n' + HISTORY,
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The package description uses "Planetarycomputer" (no space), which is inconsistent with the extension’s help text using "Planetary Computer". Consider updating the description to use consistent product naming.

Copilot uses AI. Check for mistakes.
"""Assign the user or system managed identities.

:example: Assign a user-assigned managed identity
az planetarycomputer geocatalog identity assign --name MyGeoCatalog --resource-group MyResourceGroup --user-assigned-identities "{'/subscriptions/sub-id/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-identity':{}}"
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The docstring example uses --user-assigned-identities, but this command’s argument schema only defines --user-assigned. Please update the example to match the actual CLI parameter name so the autogenerated command help is accurate.

Suggested change
az planetarycomputer geocatalog identity assign --name MyGeoCatalog --resource-group MyResourceGroup --user-assigned-identities "{'/subscriptions/sub-id/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-identity':{}}"
az planetarycomputer geocatalog identity assign --name MyGeoCatalog --resource-group MyResourceGroup --user-assigned "{'/subscriptions/sub-id/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-identity':{}}"

Copilot uses AI. Check for mistakes.
Comment on lines +64 to +70
help="Set the system managed identity.",
blank="True",
)
_args_schema.mi_user_assigned = AAZListArg(
options=["--user-assigned", "--mi-user-assigned"],
arg_group="Resource.identity",
help="Set the user managed identities.",
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

This is the identity remove command, but the argument help strings say "Set the … managed identity." This is misleading in az … identity remove help output; please change the help text to indicate removal/unassignment for both system- and user-assigned identities.

Suggested change
help="Set the system managed identity.",
blank="True",
)
_args_schema.mi_user_assigned = AAZListArg(
options=["--user-assigned", "--mi-user-assigned"],
arg_group="Resource.identity",
help="Set the user managed identities.",
help="Remove the system-assigned managed identity from the catalog.",
blank="True",
)
_args_schema.mi_user_assigned = AAZListArg(
options=["--user-assigned", "--mi-user-assigned"],
arg_group="Resource.identity",
help="Remove one or more user-assigned managed identities from the catalog.",

Copilot uses AI. Check for mistakes.
Comment on lines +28 to +34
text: |-
az planetarycomputer geocatalog create -g MyResourceGroup -n MyCatalog -l eastus
- name: Create a GeoCatalog with a user-assigned identity
text: |-
az planetarycomputer geocatalog create -g MyResourceGroup -n MyCatalog -l eastus \\
--user-assigned "/subscriptions/{sub}/resourcegroups/{rg}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{name}"
"""
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The help examples use four backslashes at line breaks (e.g., \\\\ in the source), which will render as two backslashes in the CLI help output. Other extensions use a single rendered continuation (\), so this should be reduced to \\ in the Python string to display one backslash to users.

Copilot uses AI. Check for mistakes.
Comment on lines +53 to +58
examples:
- name: Assign a user-assigned managed identity
text: |-
az planetarycomputer geocatalog identity assign -g MyResourceGroup -n MyCatalog \\
--user-assigned "/subscriptions/{sub}/resourcegroups/{rg}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{name}"
"""
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The help example here uses four backslashes for line continuation, which will display two backslashes to users. Reduce to a single rendered continuation (use \\ in the Python string) to match other extension help output.

Copilot uses AI. Check for mistakes.
Comment on lines +40 to +46
az planetarycomputer geocatalog identity assign -g MyResourceGroup -n MyCatalog --user-assigned MyIdentity

# Show identity information
az planetarycomputer geocatalog identity show -g MyResourceGroup -n MyCatalog

# Remove a user-assigned managed identity
az planetarycomputer geocatalog identity remove -g MyResourceGroup -n MyCatalog --user-assigned MyIdentity
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

In the README examples, --user-assigned MyIdentity is likely not a valid value: the command implementation expects user-assigned identity resource IDs (as shown in the extension help examples), not just an identity name. Please update the README examples to use a full resource ID (or document the accepted formats if names are supported).

Suggested change
az planetarycomputer geocatalog identity assign -g MyResourceGroup -n MyCatalog --user-assigned MyIdentity
# Show identity information
az planetarycomputer geocatalog identity show -g MyResourceGroup -n MyCatalog
# Remove a user-assigned managed identity
az planetarycomputer geocatalog identity remove -g MyResourceGroup -n MyCatalog --user-assigned MyIdentity
az planetarycomputer geocatalog identity assign -g MyResourceGroup -n MyCatalog --user-assigned /subscriptions/<subscription-id>/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyIdentity
# Show identity information
az planetarycomputer geocatalog identity show -g MyResourceGroup -n MyCatalog
# Remove a user-assigned managed identity
az planetarycomputer geocatalog identity remove -g MyResourceGroup -n MyCatalog --user-assigned /subscriptions/<subscription-id>/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyIdentity

Copilot uses AI. Check for mistakes.
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