Microsoft Power BI
40 min
the microsoft power bi connector enables streamlined interactions with power bi services, allowing users to manage reports, datasets, and apps programmatically microsoft power bi is a leading business analytics service that delivers insights for data driven decision making the microsoft power bi connector for swimlane turbine enables users to automate the integration of data visualization and analytics into their security workflows by leveraging this connector, users can dynamically add data to power bi datasets, retrieve detailed reports, and manage datasets and tables directly from the swimlane platform, enhancing their ability to visualize and analyze security data in real time this connector ingests data from the microsoft power bi and integrates it with swimlane prerequisites to utilize the microsoft power bi connector for swimlane turbine, ensure you have the following prerequisites oauth2 refresh token authentication with these parameters url endpoint url for power bi api access client id application id registered in azure active directory client secret secret key generated for the application in azure active directory authentication flow for oauth2 refresh token oauth 2 0 refresh token grant, which requires a refresh token , tenant id , client id and client secret use this auth with accounts which have mfa enabled to generate a refresh token please follow the instructions below in step 3 of the above mentioned setup instructions, please provide a redirect uri and select the platform as 'web', before clicking on register at the the bottom proceed with the remaining steps to generate 'client id', tenant id and client secret go to api permissions → add a permission → apis my organization uses → power bi service add the permissions in delegated permissions the swimlane team will provide a python script and instructions on how to use the script to generate the refresh token recommended application permissions (feel free use custom permissions if you only use certain actions) app read all report readwrite all report read all dataset readwrite all dataset read all capabilities the microsoft power bi connector integration provides the following capabilities datasets post rows get app by id get apps get datasets get report by id get reports post dataset push datasets get tables update table schema datasets api documentation link microsoft power bi api documentation link https //learn microsoft com/en us/rest/api/power bi/ configurations ms graph power bi refresh token grant authenticates using refresh token configuration parameters parameter description type required url a url to the target host string required cl id the client id string required cl secret the client secret string required refresh token refresh token string optional scope the scope for the authentication array optional verify ssl verify ssl certificate boolean optional http proxy a proxy to route requests through string optional actions datasets post rows adds new data rows to a table in a specified dataset in microsoft power bi, requiring datasetid and tablename as path parameters endpoint url v1 0/myorg/datasets/{{datasetid}}/tables/{{tablename}}/rows method post input argument name type required description datasetid string required response data tablename string required name of the resource rows array optional parameter for datasets post rows productid number optional unique identifier name string optional name of the resource category string optional parameter for datasets post rows iscompete boolean optional parameter for datasets post rows manufacturedon string optional parameter for datasets post rows output parameter type description status code number http status code of the response reason string response reason phrase example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" {} } ] get app by id retrieves details of a specified microsoft power bi app using its unique appid endpoint url v1 0/myorg/apps/{{appid}} method get input argument name type required description appid string required unique identifier output parameter type description status code number http status code of the response reason string response reason phrase id string unique identifier description string output field description name string name of the resource publishedby string output field publishedby lastupdate string date value example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" { "id" "f089354e 8366 4e18 aea3 4cb4a3a50b48", "description" "the finance app", "name" "finance", "publishedby" "bill", "lastupdate" "2019 01 13t09 46 53 094+02 00" } } ] get apps retrieve a list of installed microsoft power bi apps available to the user endpoint url v1 0/myorg/apps method get output parameter type description status code number http status code of the response reason string response reason phrase value array value for the parameter id string unique identifier description string output field description name string name of the resource publishedby string output field publishedby lastupdate string date value example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" { "value" \[] } } ] get datasets retrieve a list of datasets available in the user's microsoft power bi workspace endpoint url v1 0/myorg/datasets method get output parameter type description status code number http status code of the response reason string response reason phrase value array value for the parameter id string unique identifier name string name of the resource addrowsapienabled boolean output field addrowsapienabled configuredby string output field configuredby isrefreshable boolean output field isrefreshable iseffectiveidentityrequired boolean unique identifier iseffectiveidentityrolesrequired boolean unique identifier isonpremgatewayrequired boolean output field isonpremgatewayrequired example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" { "value" \[] } } ] get report by id retrieves a specific microsoft power bi report using the provided report id endpoint url v1 0/myorg/reports/{{reportid}} method get input argument name type required description reportid string required unique identifier output parameter type description status code number http status code of the response reason string response reason phrase datasetid string response data id string unique identifier name string name of the resource weburl string url endpoint for the request embedurl string url endpoint for the request example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" { "datasetid" "cfafbeb1 8037 4d0c 896e a46fb27ff229", "id" "5b218778 e7a5 4d73 8187 f10824047715", "name" "salesmarketing", "weburl" "https //app powerbi com//reports/5b218778 e7a5 4d73 8187 f10824047715", "embedurl" "https //app powerbi com/reportembed?reportid=5b218778 e7a5 4d73 8187 f1082404771 " } } ] get reports retrieves a comprehensive list of power bi reports, including shared reports and those from shared apps endpoint url v1 0/myorg/reports method get output parameter type description status code number http status code of the response reason string response reason phrase value array value for the parameter datasetid string response data id string unique identifier name string name of the resource weburl string url endpoint for the request embedurl string url endpoint for the request example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" { "value" \[] } } ] post dataset creates a new dataset in microsoft power bi with specified 'name' and 'tables' structure provided in the json body endpoint url v1 0/myorg/datasets method post input argument name type required description defaultretentionpolicy string optional parameter for post dataset name string required name of the resource defaultmode string optional parameter for post dataset tables array required parameter for post dataset name string optional name of the resource columns array optional parameter for post dataset name string optional name of the resource datatype string optional response data formatstring string optional parameter for post dataset output parameter type description status code number http status code of the response reason string response reason phrase id string unique identifier name string name of the resource defaultretentionpolicy string output field defaultretentionpolicy example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" { "id" "cfafbeb1 8037 4d0c 896e a46fb27ff229", "name" "salesmarketing", "defaultretentionpolicy" "basicfifo" } } ] push datasets get tables retrieves a list of tables from a specified dataset in microsoft power bi, requiring the datasetid as a path parameter endpoint url v1 0/myorg/datasets/{{datasetid}}/tables method get input argument name type required description datasetid string required response data output parameter type description status code number http status code of the response reason string response reason phrase example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" {} } ] update table schema datasets updates the metadata and schema of a table in a specified dataset in microsoft power bi, requiring datasetid, tablename, columns, and name endpoint url v1 0/myorg/datasets/{{datasetid}}/tables/{{tablename}} method put input argument name type required description datasetid string required response data tablename string required name of the resource columns object required parameter for update table schema datasets name string required name of the resource description string optional parameter for update table schema datasets ishidden boolean optional unique identifier measures object optional parameter for update table schema datasets rows object optional parameter for update table schema datasets id string optional unique identifier source object optional parameter for update table schema datasets expression string optional parameter for update table schema datasets output parameter type description status code number http status code of the response reason string response reason phrase example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" {} } ] notes for more information on microsoft power bi is found at microsoft power bi main site https //powerbi microsoft com/en in/