The error message "Invalid license, missing consent" often indicates that you have not given the appropriate permissions to your application or you have not accepted the necessary consent.
When you're enabling the Microsoft Defender for Endpoint data connector, you need to grant Azure Sentinel reader permissions over the Microsoft Defender for Endpoint data. You can do this by adding Azure Sentinel as a reader on the Microsoft Defender Security Center. Here are the steps that you need to follow:
- In the Defender Security Center, go to Settings > Permissions > (API) Azure Sentinel
- Click on "Add Azure Sentinel". This will open the Azure portal.
- Select the Azure Sentinel workspace that you want to connect.
- Click "Add".
If you already did this and you're still having issues, it's possible that you need to accept the consent on behalf of your organization. You can do this by following these steps:
- Open the Azure portal.
- Go to Azure Active Directory > App registrations.
- Select your application.
- Click on "API permissions".
- Click on "Grant admin consent for (your organization)".
Please refer to the following documents for more information: