Azure Reservation Recommendation API can't get Shared and Single scope at same time

Ngô Nhật Tân 25 Reputation points
2023-11-08T07:33:55.72+00:00

Hi I was try to follow on this page instruction to get Reservation Recommendation data. By default, the value for field "properties/resourceType" is VirtualMachines.

I would like to get the resourceType equal to VirtualMachines or Cosmos DB so I try this call these apis:

  1. Use OR operation

https://management.azure.com/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendations?$filter=properties/scope eq 'Single' AND (properties/resourceType eq 'CosmosDB' OR properties/resourceType eq 'VirtualMachines')&api-version=2023-05-01

But I get this error: Filtering on multiple resource types is not supported

  1. Use IN operation

https://management.azure.com/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendations?$filter=properties/scope eq 'Single' AND properties/resourceType in ('CosmosDB, VirtualMachines')&api-version=2023-05-01

But I get this error: Processing query expression failed. Error: Nodes of type: 'In' not supported

  1. Use search.in function

https://management.azure.com/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendations?$filter=properties/scope eq 'Single' AND search.in(properties/resourceType, 'CosmosDB, VirtualMachines')&api-version=2023-05-01

But I get this error: Processing query expression failed. Error: An unknown function with name 'search.in' was found. This may also be a function import or a key lookup on a navigation property, which is not allowed

Can I ask how could get multiple resource Type at the same time? Thanks a lot

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
2,349 questions
0 comments No comments
{count} votes

Accepted answer
  1. SwathiDhanwada-MSFT 18,551 Reputation points
    2023-11-13T11:07:01.5+00:00

    Ngô Nhật Tân Thanks for reaching out. Currently the API supports only one ResourceType per call.  This is a known limitation and product team is working on adding multiple resource types in single call and currently, we don't have an ETA for the same.

     

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful