Skip to content

Filters do not work / ResourceGraphQuerys for advanced Filters #20

Open
@AndreasMWalter

Description

@AndreasMWalter

First of I assume the additional filters do not work, since you encountered issues upon implementing them.
I noticed that the REST API does not support all odata Filter options that one would assume that it should.

Microsoft has created resource graph for performant resource exploration
Using the Resource Graph Go Module should give the ability to both use advanced filters as well as looking up resources based on a management group such as for example a sandbox management group where the janitor would work on resources that are in the subscriptions below that management group removing the necessity to configure the janitor call each time a new sandbox subscription is added to that management group.

Example Query

	results, err := resGraphClient.Resources(ctx,
		armresourcegraph.QueryRequest{
			Query: to.Ptr("ResourceContainers | where type=='microsoft.resources/subscriptions/resourcegroups' | where tags['ttl'] and tags['ttl_excluded'] | project name, tags"),
			Subscriptions: []*string{
				to.Ptr(subscriptionId)},
		},
		nil)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions