/// <summary> /// Get protection containers count from BackupUsageSummary /// </summary> public static long?GetProtectionContainersCount(string vaultName, string resourceGroupName, ServiceClientAdapter serviceClientAdapter) { ODataQuery <BMSBackupSummariesQueryObject> queryFilter = new ODataQuery <BMSBackupSummariesQueryObject>( q => q.Type == "BackupProtectionContainerCountSummary"); long?containersCount = 0; IEnumerable <BackupManagementUsage> backupUsageSummary = serviceClientAdapter.GetBackupUsageSummary( vaultName, resourceGroupName, queryFilter); foreach (BackupManagementUsage containerSummary in backupUsageSummary) { containersCount += containerSummary.CurrentValue; } return(containersCount); }