Skip to content

{ACR} az acr show-usage: Add examples for MaximumStorageCapacity and Size query#32263

Merged
yanzhudd merged 11 commits intoAzure:devfrom
brethompson309:brethompson/add-descriptions-for-azacrshowusage
Oct 28, 2025
Merged

{ACR} az acr show-usage: Add examples for MaximumStorageCapacity and Size query#32263
yanzhudd merged 11 commits intoAzure:devfrom
brethompson309:brethompson/add-descriptions-for-azacrshowusage

Conversation

@brethompson309
Copy link
Copy Markdown
Contributor

@brethompson309 brethompson309 commented Oct 15, 2025

Related command
az acr show-usage

Description
We are adding a new listUsage entity to our API to expose "MaximumStorageCapacity". This will allow us to show the maximum storage capacity of the registry without altering the existing structure of the API.

The update to the help command helps users under the different between the "Size" and "MaximumStorageCapacity" listUsages entities and how to query them.

Testing Guide
Example of az acr show-usage --help

Command
    az acr show-usage : Get the storage usage for an Azure Container Registry.

Arguments
    --name -n [Required] : The name of the container registry. It should be specified in lower case.
                           You can configure the default registry name using `az configure
                           --defaults acr=<registry name>`.
    --resource-group -g  : Name of resource group. You can configure the default group using `az
                           configure --defaults group=<name>`.

Global Arguments
    --debug              : Increase logging verbosity to show all debug logs.
    --help -h            : Show this help message and exit.
    --only-show-errors   : Only show errors, suppressing warnings.
    --output -o          : Output format.  Allowed values: json, jsonc, none, table, tsv, yaml,
                           yamlc.  Default: json.
    --query              : JMESPath query string. See http://jmespath.org/ for more information and
                           examples.
    --subscription       : Name or ID of subscription. You can configure the default subscription
                           using `az account set -s NAME_OR_ID`.
    --verbose            : Increase logging verbosity. Use --debug for full debug logs.

Examples
    Get the storage usage for an Azure Container Registry.
        az acr show-usage -n myregistry
    Get the current amount of storage used by the registry (in bytes). 
        az acr show-usage -n myregistry --query "value[?name=='Size'] | [0]" 
    Get the maximum storage limit allowed for the registry based on its SKU.
        az acr show-usage -n myregistry --query "value[?name=='MaximumStorageCapacity'] | [0]" 

**History Notes**
<!--If your PR is not customer-facing, use {Component Name} in the PR title. Otherwise, use [Component Name] to allow our pipeline to add the title as a history note. If you need multiple history notes or would like to overwrite the note from the PR title, please fill in the following templates.-->

[Component Name 1] BREAKING CHANGE: `az command a`: Make some customer-facing breaking change
[Component Name 2] `az command b`: Add some customer-facing feature

---

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

- [X ] The PR title and description has followed the guideline in [Submitting Pull Requests](https://github.com/Azure/azure-cli/tree/dev/doc/authoring_command_modules#submitting-pull-requests).

- [X ] I adhere to the [Command Guidelines](https://github.com/Azure/azure-cli/blob/dev/doc/command_guidelines.md).

- [ X] I adhere to the [Error Handling Guidelines](https://github.com/Azure/azure-cli/blob/dev/doc/error_handling_guidelines.md).

Copilot AI review requested due to automatic review settings October 15, 2025 17:12
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Oct 15, 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 Oct 15, 2025

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Oct 15, 2025

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

@github-actions
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>

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 help documentation examples for the az acr show-usage command to clarify the difference between "Size" and "MaximumStorageCapacity" usage entities and demonstrate how to query them specifically using JMESPath queries.

  • Added example showing how to query the current storage usage ("Size")
  • Added example showing how to query the maximum storage capacity limit ("MaximumStorageCapacity")

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

Comment on lines +901 to +906
- name: Size: The current amount of storage used by the registry (in bytes).
text: >
az acr show-usage -n myregistry --query "value[?name=='Size'] | [0]"
- name: MaximumStorageCapacity: The maximum storage limit allowed for the registry based on its SKU (in bytes).
text: >
az acr show-usage -n myregistry --query "value[?name=='MaximumStorageCapacity'] | [0]"
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

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

The indentation is inconsistent. Lines 902, 905 should use 4 spaces for indentation to match the existing pattern, but they appear to use 6 spaces instead of the expected 4.

Copilot uses AI. Check for mistakes.
Comment thread src/azure-cli/azure/cli/command_modules/acr/_help.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/acr/_help.py Outdated
@microsoft-github-policy-service microsoft-github-policy-service bot added the Auto-Assign Auto assign by bot label Oct 15, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group label Oct 15, 2025
brethompson309 and others added 2 commits October 15, 2025 10:15
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@northtyphoon northtyphoon left a comment

Choose a reason for hiding this comment

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

nit: format

- name: Get the storage usage for an Azure Container Registry.
text: >
az acr show-usage -n myregistry
- name: Get the current amount of storage used by the registry (in bytes).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The Size item shows the current storage usage and the included storage limit based on its SKU. The maximum storage capacity is not dependent on SKU. Let's update the descriptions accordingly. The maximum storage limit one does not need to mention sku

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jaysterp Updated the naming to what Payal, you, and I had discussed offline. Let me know if you would like any other edits!

Copy link
Copy Markdown
Member

@jaysterp jaysterp left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@yanzhudd
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@yanzhudd yanzhudd changed the title [ACR] az acr show-usage command: add examples for MaximumStorageCapacity and Size query {ACR} az acr show-usage: Add examples for MaximumStorageCapacity and Size query Oct 28, 2025
Copy link
Copy Markdown
Member

@northtyphoon northtyphoon left a comment

Choose a reason for hiding this comment

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

LGTM

@yanzhudd yanzhudd merged commit d849be0 into Azure:dev Oct 28, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants