Skip to content

[Storage] az storage account or-policy create/update: Add --enable-metrics to support object replication metrics - #32082

Merged
Zhiyi Huang (calvinhzy) merged 3 commits into
Azure:devfrom
calvinhzy:storage-account-or-policy-metrics-ga
Sep 9, 2025
Merged

Zhiyi Huang (calvinhzy) merged 3 commits into
Azure:devfrom
calvinhzy:storage-account-or-policy-metrics-ga

Conversation

@calvinhzy

@calvinhzy Zhiyi Huang (calvinhzy) commented Sep 8, 2025 •

Copy link
Copy Markdown
Contributor

Related command

Description

Testing Guide

History Notes

[Storage] az storage account or-policy create/update: Add --enable-metrics to support object replication metrics


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

…z storage account or-policy create/update`
@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Sep 8, 2025 •

Copy link
Copy Markdown
️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Sep 8, 2025 •

Copy link
Copy Markdown
⚠️AzureCLI-BreakingChangeTest
⚠️storage
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd storage account or-policy create cmd storage account or-policy create added parameter enable_metrics
⚠️ 1004 - CmdPropRemove storage account or-policy create cmd storage account or-policy create removed property is_preview
⚠️ 1004 - CmdPropRemove storage account or-policy delete cmd storage account or-policy delete removed property is_preview
⚠️ 1004 - CmdPropRemove storage account or-policy list cmd storage account or-policy list removed property is_preview
⚠️ 1004 - CmdPropRemove storage account or-policy rule add cmd storage account or-policy rule add removed property is_preview
⚠️ 1004 - CmdPropRemove storage account or-policy rule list cmd storage account or-policy rule list removed property is_preview
⚠️ 1004 - CmdPropRemove storage account or-policy rule remove cmd storage account or-policy rule remove removed property is_preview
⚠️ 1004 - CmdPropRemove storage account or-policy rule show cmd storage account or-policy rule show removed property is_preview
⚠️ 1004 - CmdPropRemove storage account or-policy rule update cmd storage account or-policy rule update removed property is_preview
⚠️ 1004 - CmdPropRemove storage account or-policy show cmd storage account or-policy show removed property is_preview
⚠️ 1006 - ParaAdd storage account or-policy update cmd storage account or-policy update added parameter enable_metrics
⚠️ 1004 - CmdPropRemove storage account or-policy update cmd storage account or-policy update removed property is_preview

@yonzhan

Copy link
Copy Markdown
Collaborator

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

@github-actions

github-actions Bot commented Sep 8, 2025

Copy link
Copy Markdown

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>

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 adds the --enable-metrics flag to the az storage account or-policy create and update commands, allowing users to control whether object replication metrics are enabled for storage account object replication policies. The change also removes the preview flag from the object replication policy commands.

  • Add --enable-metrics parameter to create and update object replication policy commands
  • Update function signatures and implementation to handle metrics configuration
  • Remove preview flags from object replication policy command groups
  • Add test coverage for the new metrics functionality

Reviewed Changes

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

File Description
_params.py Adds the --enable-metrics argument definition with help text
account.py Updates create and update functions to handle the metrics parameter
commands.py Removes preview flags from object replication policy command groups
test_storage_account_scenarios.py Adds test coverage for the new metrics functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +797 to +798
c.argument('enable_metrics', arg_type=get_three_state_flag(),
help='Indicates whether object replication metrics feature is enabled for the policy.')

Copilot AI Sep 8, 2025

Copy link

Choose a reason for hiding this comment

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

The help message should start with a verb in the imperative voice. Consider changing 'Indicates whether...' to 'Enable or disable object replication metrics for the policy.'

Copilot uses AI. Check for mistakes.
Comment thread src/azure-cli/azure/cli/command_modules/storage/operations/account.py Outdated
@evelyn-ys Yishi Wang (evelyn-ys) changed the title [Storage] az storage account or-policy create/update: Add --enable-metrics [Storage] az storage account or-policy create/update: Add --enable-metrics to support object replication metrics Sep 9, 2025
@calvinhzy
Zhiyi Huang (calvinhzy) merged commit 3d94131 into Azure:dev Sep 9, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot Storage az storage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants