I followed the below document and tried getting an access token from Azure AD.
I am getting an error that request body must contain grant_type ,even though its being pass as part of the request body.
I tried the same with postman and got the same error.
https://learn.microsoft.com/en-us/rest/api/eventhub/get-azure-active-directory-token#see-also
curl --location --request GET 'https://login.microsoftonline.com/MY-TENANT-ID/oauth2/token' --header 'Content-Type: application/x-www-form-urlencoded' --form 'grant_type="client_credentials"' --form 'client_id="MY-CLIENT_ID"' --form 'client_secret="MY-CLIENT-IDS-SECRET"' --form 'resource="https://eventhubs.azure.net"'
{"error":"invalid_request","error_description":"AADSTS900144: The request body must contain the following parameter: 'grant_type'.\r\nTrace ID: 80a20306-05bf-4054-b240-b1eb1ec0d300\r\nCorrelation ID: 0292cf87-b34d-4586-b89b-e057741bc3fa\r\nTimestamp: 2021-07-15 14:38:29Z","error_codes":[900144],"timestamp":"2021-07-15 14:38:29Z","trace_id":"80a20306-05bf-4054-b240-b1eb1ec0d300","correlation_id":"0292cf87-b34d-4586-b89b-e057741bc3fa","error_uri":"https://login.microsoftonline.com/error?code=900144"}