Write data to Power BI using SSIS (Import data)
In this section we will learn how to configure and use Power BI Connector in the API Destination to write data to Power BI.
Video tutorial
This video covers following and more so watch carefully. After watching this video follow the steps described in this article.
- How to download SSIS PowerPack for
Power BI integration in SSIS - How to configure connection for
Power BI - How to write or lookup data to
Power BI - Features about SSIS API Destination
- Using
Power BI Connector in SSIS
Step-by-step instructions
In upper section we learned how to read data, now in this section we will learn how to configure Power BI in the API Source to POST data to the Power BI.
-
Read the data from the source, being any desired source component. In example we will use ZappySys Dummy Data Source component.
-
From the SSIS Toolbox drag and drop API Destination (Predefined Templates) on the Data Flow Designer surface and connect source component with it, and double click to edit it.
-
Select New Connection to create a new connection:
API Destination - Power BIConnect to your Power BI account and retrieve data, refresh datasets, etc. -
Use a preinstalled Power BI Connector from Popular Connector List or press Search Online radio button to download Power BI Connector. Once downloaded simply use it in the configuration:
Power BI -
Proceed with selecting the desired Authentication Type. Then select API Base URL (in most cases default one is the right one). Finally, fill in all the required parameters and set optional parameters if needed. You may press a link Steps to Configure which will help set certain parameters. More info is available in Authentication section.
OAuth App must be created in Microsoft Azure AD. These settings typically found here https://docs.microsoft.com/en-us/graph/auth-register-app-v2. [API reference]
Steps how to get and use Power BI credentials : User Credentials [OAuth]
Firstly, login into Azure Portal and there create an OAuth application:
- Go to Azure Portal and login there.
- Then go to Azure Active Directory.
- On the left side click menu item App registrations
- Then proceed with clicking New registration.
- Enter a name for your application.
- Select the account types to support with the Supported account types option.
- In Redirect URI, select Web.
- In the textbox enter https://zappysys.com/oauth as the Redirect URI or another valid redirect URL.
- Use this same Redirect URI in the Redirect URI (must match App Redirect URL) grid row.
- Copy Client ID and paste it into the API Connection Manager configuration grid in the Client ID row.
- Click on the Endpoints link and copy the OAuth 2.0 authorization endpoint (v2) URL to the Authorization URL grid row. Usually it looks similar to this:
- https://login.microsoftonline.com/daed1250-xxxx-xxxx-xxxx-ef0a982d3d1e/oauth2/v2.0/authorize
- Copy the OAuth 2.0 token endpoint (v2) URL to the Token URL grid row. Usually it looks similar to this:
- https://login.microsoftonline.com/daed1250-xxxx-xxxx-xxxx-ef0a982d3d1e/oauth2/v2.0/token
- Close "Endpoints" popup and create a Client Secret in the Certificates & secrets tab.
- Proceed by clicking New client secret and setting expiration period. Copy the client secret and paste it into configuration grid in Client Secret row.
- Now lets setup permissions for the app. Click on API Permissions and on the page click Plus Sign Add Permission
- Click on Microsoft Graph API and then choose Delegated Permissions
- on Permission list page search or choose permissions as needed. We need to enable following Permissions from 2 Sections: Microsoft Graph API and Power BI Service.
- Make sure you have checked below permissions (If you do not need Write feature then you can skip Write scopes)
offline_access Dataset.ReadWrite.All
- Click Generate Token to generate tokens.
- That's it!
Fill in all required parameters and set optional parameters if needed:
PowerBiDSNPower BIUser Credentials [OAuth]https://api.powerbi.com/v1.0/myorgRequired Parameters Authorization URL Fill-in the parameter... Token URL Fill-in the parameter... Client ID Fill-in the parameter... Scope Fill-in the parameter... Default Dataset (select after generating tokens) Fill-in the parameter... Optional Parameters Client Secret Redirect URI (must match App Redirect URI) Default Workspace (Keep Empty for My Workspace - select after generating tokens) RetryMode RetryWhenStatusCodeMatch RetryStatusCodeList 429|503 RetryCountMax 20 RetryWaitTimeMs 1000 RetryMultiplyWaitTime True Login options -
Select the desired endpoint, change/pass the properties values, and go to the Mappings tab to map the columns.
API Destination - Power BIConnect to your Power BI account and retrieve data, refresh datasets, etc. -
Finally, map the desired columns:
API Destination - Power BIConnect to your Power BI account and retrieve data, refresh datasets, etc. -
That's it; we successfully configured the POST API Call. In a few clicks we configured the Power BI API call using ZappySys Power BI Connector