To securely connect MuleSoft to Power BI using OAuth, follow these steps:
Set Up OAuth in Azure
Register an App in Azure AD
- Go to Azure Portal → App Registrations → New Registration.
- Add Redirect URI (e.g., https://localhost).
- Note the Client ID and Tenant ID.
Grant API Permissions
- Under API Permissions, add Power BI Service → App.ReadWrite.All (Admin Consent required).
- In Certificates & Secrets, generate a Client Secret.
Configure OAuth in MuleSoft
Set Up OAuth in Anypoint Studio
- Use the OAuth 2.0 Authorization Code grant type.
- Provide Client ID, Client Secret, Token URL (https://login.microsoftonline.com/{tenantID}/oauth2/token).
Authorization: Bearer {access_token}
Test Power BI API Calls
Validate with endpoints like:
GET https://api.powerbi.com/v1.0/myorg/reports