Skip to content

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

Merged
calvinhzy merged 3 commits intoAzure:devfrom
calvinhzy:storage-account-or-policy-metrics-ga
Sep 9, 2025
Merged

[Storage] az storage account or-policy create/update: Add --enable-metrics to support object replication metrics#32082
calvinhzy merged 3 commits intoAzure:devfrom
calvinhzy:storage-account-or-policy-metrics-ga

Conversation

@calvinhzy
Copy link
Copy Markdown
Member

@calvinhzy calvinhzy commented Sep 8, 2025

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`
@calvinhzy calvinhzy self-assigned this Sep 8, 2025
Copilot AI review requested due to automatic review settings September 8, 2025 16:12
@azure-client-tools-bot-prd
Copy link
Copy Markdown

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

️✔️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
Copy link
Copy Markdown

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

⚠️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

yonzhan commented Sep 8, 2025

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 8, 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>

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 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.')
Copy link

Copilot AI Sep 8, 2025

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 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 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