Hi Edgar,
You may retrieve usage information (same data you see in portal) via REST API :
Usages - List By Vault
Please click Accept Answer and upvote if the above was helpful.
Thanks.
-TP
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello everyone.
I am working on obtaining the total amount of backup storage space as you can see below, I can get that inside the recovery services vaults pane, but I want to find a way to obtain that same value using a script either PowerShell or Bash, been working on some CLI commands but none of them are working, has somebody done this or can you point me in the right direction please.
Thank You for your time
Best Regards.
Hi Edgar,
You may retrieve usage information (same data you see in portal) via REST API :
Usages - List By Vault
Please click Accept Answer and upvote if the above was helpful.
Thanks.
-TP
Following az cli command can help you out. Please use it by substituting your own variables
az rest --method GET --url "https://management.azure.com/Subscriptions/yoursubname/resourceGroups/yourgsname/providers/Microsoft.RecoveryServices/vaults/yourvaultname/usages?api-version=2024-10-01"
Here is the value from portal
az cli shows the corresponding value as follows
Hope this helps.
--please don't forget to upvote
and Accept as answer
if the reply is helpful--
Note the units field in the cli output says the values are in bytes
However, the azure portal reports the size in GB
Here is an online converter result and it matches:
Hello @Manu Philip
Your command worked but I noticed a discrepancy in the output for the size in the console and from the command you provide, in the console I am getting 84.82 GBs and from the command I am getting 91075183616 bytes which that gives us 91.07 GBs, do you know why is there a difference?
Web Console
CLI Command
Best Regards.
Thank you .
Your answers helped me solve this.
Best Regards.