Grant service principal access to Power BI gateway
Visit https://app.powerbi.com/home and click the gear symbol followed by Manage gateways. Select the gateway you configured in part 5 followed by the target data source (DEV SQL server in our example). Note down the gateway ID and data source ID in a handy location as you’ll need it shortly.
Visit https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/adddatasourceuser and click Try It. Enter the datasourceId and gatewayId using the values you obtained earlier in this step, and update the content body using the Object ID value you obtained in part 2 to contain the following payload:
{
“identifier”: “Service Principal Object ID From part 2“,
“datasourceAccessRight”: “Read”
}
Once you’ve crafted the API request with all the appropriate values as outlined above, click Run and ensure you receive a Response Code of 200. If not, please revisit the previous steps to ensure you’ve completed the prerequisites.
Visit https://app.powerbi.com/home, click the gear symbol then Manage gateways. Select the gateway you created in part 5 followed by the target data source (DEV SQL server in our example) followed by selecting Users and validating you now see the Application Name you defined in part 1.
Previous article: Create Gateway
Next article: Get Data for Power BI Report