Hi
I am working with the Azure Rest API to get information about how well the resources follow the Microsoft Defender for Cloud Recommendations.
I have a list of resources in azure on our end we want to check if follow the microsoft defender for cloud recommendations. The resources are in several different subscriptions and resource groups, so I can not use the endpoint to get all these recommendations from a single subscription:
Assessments - List - REST API (Azure Defender for Cloud) | Microsoft Learn
What I thought would be the best way to solve this, is to invoke a API-call to each one of these resources individually, to see all the defender for cloud recommendations for that resource and whether or not the resource follows these recommendations.
I see there is a endpoint to get an assessment for a single resource, but you have to specify a single assessment name in the call:
Assessments - Get - REST API (Azure Defender for Cloud) | Microsoft Learn
There are approximately 750 different assessment names, so to check all the recommendations for a single resource, I have to run the API-call 750 times, which is a little excessive.
Is there a better way to check a single resource in azure for all the relevant recommendations from defender for cloud? Or is there a way to get a list of all relevant assessment names for resource type, so I don't have to go through all 750?