Forum Discussion
Guidance on Updating Cloud Connection Data Source Credentials Using Rest API
Hi rmjenkinsquest ,
According to our understanding, the fields you provided in the screenshot such as tenant ID, SP ID/secret are required fields to generate the AAD token in order to use the generated AAD token as authorization to run the Power BI rest API, so these fields are not provided as parameters in the Power BI rest API. So these fields are not provided as parameters in the Power BI rest API, but are required fields to get the AAD token in the previous step.
Datasets - Update Datasources In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
And the Power Automate HTTP action solution I provided before is combining the AAD token acquisition step directly inside the action, so these fields need to be filled in during this validation step:
There are also options on how to use the API directly to get AAD tokens, you can search for similar Q&A documents online:
Generate Access Token via Service Principal - Microsoft Q&A
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Liu,
Apologies for the confusion that may have resulted from an incomplete screenshot--I cropped the prompt so as to conceal the server and database information. The screenshot is for configuring data source credentials on a semantic model ("Settings" of the semantic model → "Data source credentails" → "Edit credentials), not in generating an access token for the REST API
Here are the tasks we are attempting via PowerShell:
1. Build service principal credential and generate access token for subsequent calls (Working)
2. Connect to workspace environment (Working)
3. Import semantic model from Git repository and bind to report (Working)
4. Update semantic model parameters in group (Working)
5. Configure semantic model data source credentails
The fifth task is what I have been unable to accomplish thus far and am looking for guidance on, since I have not found any helpful examples on using Datasets - Update Datasources in Group for service principal-type authentication to the database for the semantic model