Skip to content

Conversation

@kshitij-microsoft
Copy link
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.

Copilot AI review requested due to automatic review settings November 3, 2025 17:55
@azure-client-tools-bot-prd
Copy link

Validation for Breaking Change Starting...

Thanks for your contribution!

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

Hi @kshitij-microsoft,
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.

@yonzhan
Copy link
Collaborator

yonzhan commented Nov 3, 2025

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

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

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

github-actions bot commented Nov 3, 2025

Hi @kshitij-microsoft

Release Suggestions

Module: machinelearningservices

  • Please log updates into to src/machinelearningservices/HISTORY.rst
  • Update VERSION to 2.40.1 in src/machinelearningservices/setup.py

Notes

Copy link
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 adds comprehensive deployment template management commands to the Azure Machine Learning CLI extension. Deployment templates provide a way to standardize and share deployment configurations across teams and projects in Azure ML registries.

  • Introduces six new CLI commands for managing deployment templates: list, get, create, update, archive, and restore
  • Implements registry-based operations with proper error handling and serialization support
  • Adds comprehensive help documentation and parameter definitions

Reviewed Changes

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

Show a summary per file
File Description
deployment_template.py Core implementation of six deployment template management functions with error handling and serialization logic
commands.py Registers the new ml deployment-template command group with appropriate command bindings
_deployment_template_params.py Defines CLI parameters for all deployment template commands with registry-name requirements
_deployment_template_help.py Provides comprehensive help text and usage examples for all deployment template commands
__init__.py files Import statements to expose new functionality
CHANGELOG.rst Documents the new commands in the changelog


module_logger = logging.getLogger(__name__)
module_logger.propagate = 0
logger = logging.getLogger(__name__)
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

Two logger instances are created for the same module, but only module_logger is used in the code. The unused logger variable on line 22 should be removed.

Suggested change
logger = logging.getLogger(__name__)

Copilot uses AI. Check for mistakes.
command_type=custom_deployment_template)
g.generic_update_command(
"update",
getter_name="ml_deployment_template_get",
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

The getter function name should be _ml_deployment_template_show to match the generic_update_command pattern used elsewhere in this file. The function _ml_deployment_template_show is defined in deployment_template.py (line 162) but ml_deployment_template_get is referenced here as the getter, which will cause the update command to fail.

Suggested change
getter_name="ml_deployment_template_get",
getter_name="_ml_deployment_template_show",

Copilot uses AI. Check for mistakes.
Comment on lines +185 to +201
def ml_deployment_template_archive(
cmd,
name,
version=None,
registry_name=None,
no_wait=False,
**kwargs, # pylint: disable=unused-argument
):
"""Archive a deployment template."""
ml_client, debug = get_ml_client(
cli_ctx=cmd.cli_ctx, registry_name=registry_name
)

try:
ml_client.deployment_templates.archive(name=name, version=version)
except Exception as err: # pylint: disable=broad-except
log_and_raise_error(err, debug)
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

The no_wait parameter is accepted but never used in the function implementation. Either implement no-wait functionality (similar to the pattern in ml_deployment_template_create lines 115-123) or remove the parameter from the function signature.

Copilot uses AI. Check for mistakes.
Comment on lines +204 to +220
def ml_deployment_template_restore(
cmd,
name,
version=None,
registry_name=None,
no_wait=False,
**kwargs, # pylint: disable=unused-argument
):
"""Restore an archived deployment template."""
ml_client, debug = get_ml_client(
cli_ctx=cmd.cli_ctx, registry_name=registry_name
)

try:
ml_client.deployment_templates.restore(name=name, version=version)
except Exception as err: # pylint: disable=broad-except
log_and_raise_error(err, debug)
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

The no_wait parameter is accepted but never used in the function implementation. Either implement no-wait functionality (similar to the pattern in ml_deployment_template_create lines 115-123) or remove the parameter from the function signature.

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

4 participants