Hi Sagar,
There's a good article in Medium for using/testing graph connections.
https://mauridb.medium.com/calling-azure-rest-api-via-curl-eb10a06127
As you may know, it's a 2 step process:
- request a token using a POST request
-query your resource
To get your token, you need to go here:
curl -X POST -d 'grant_type=client_credentials&client_id=[APP_ID]&client_secret=[PASSWORD]&resource=https%3A%2F%2Fmanagement.azure.com%2F' https://login.microsoftonline.com/[TENANT_ID]/oauth2/token
Note that you will need to create a service principal for the above command.
The article shows a clever way to do it with az commands but I usually configure an app registration in Azure.
Then you can query your resource with your token.
Remember there's a different url for every resource so you really need to know what you're looking for. The example in the article I mentioned is looking at the list of subscriptions for a given tenant:
curl -X GET -H "Authorization: Bearer [TOKEN]" -H "Content-Type: application/json" https://management.azure.com/subscriptions/[SUBSCRIPTION_ID]/providers/Microsoft.Web/sites?api-version=2016-08-01
Hope that helps.