Can't filter on both (tagName/tagValue) and resourceType

Christoffer Pedersen 20 Reputation points
2024-02-01T12:40:02.77+00:00

I have a problem where I am trying to discover services on my subscription via the Azure REST service "Resource Management". I am trying to list resources of a certain type, that fit a certain criteria, where I want to specify a tag as well. But when I try passing the following filter:

resourceType eq 'Microsoft.DBforPostgreSQL/flexibleServers' and tagName eq 'service' and tagValue eq 'customerService'

I get an error saying the filter is not valid.
I tried following the following learn page:
https://learn.microsoft.com/en-us/rest/api/resources/resources/list?view=rest-resources-2021-04-01
But this could not help me, as it didn't mention any restriction on combining queries of resourceType and tagName/tagValue. How come this is not something I can do? Is it possible to get this API updated in order to accomplish this? It is very fustrating as there is very little documentation.

Azure Database for PostgreSQL
0 comments No comments
{count} votes

Accepted answer
  1. Stanislav Zhelyazkov 21,181 Reputation points MVP
    2024-02-01T12:43:56.15+00:00

    Hi, The rest APIs are very limited in terms of searching and filtering. Also they are very slow. I would suggest to Azure Resource Graph. It also has REST API that you run your queries against.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful