Forum Discussion

nk-alex's avatar
nk-alex
New Member
10 months ago
Solved

Unable to create Datasource on PowerBI API

Hi all, I'm trying to use PowerBI REST API in order to create a datasource. I'm using the endpoint (POST) https://api.powerbi.com/v1.0/myorg/gateways/{id}/datasources with the following body:   ...
  • v-tejrama's avatar
    v-tejrama
    10 months ago

    Hi nk-alex ,

     

    Great question unfortunately, DAX in Power BI is just for calculations and modeling, so it can't make REST API calls, handle encryption, or talk to gateways. The datasource creation you're working on happens outside of Power BI, so you'll need to use something like PowerShell, Postman, or a backend script in Python or C# to get that done.

     

    If you just want to see or build the JSON body, Power Query can help with that, but it still can't do encryption or actually create the datasource through the API. Those parts have to be done with external tools to keep things secure.

     

    So, DAX isn't able to test or set up this process you'll need an external tool that can handle encryption and REST API requests.

    Thank you.