Power BI is a tool that you can connect to and generate reports using your own data sources. This article will walk you through setting up a Power BI credential in Tines.
Create a Power BI credential in Tines
In your Tines tenant, navigate to the credentials section for the Team you want to create the credential in.
Select “+ New” > “Manual Creation” > “OAuth 2.0” > “Create Credential”.
Set name as “PowerBI” and product as “PowerBI”.
Copy the callback URL for later (i.e https://tenant-name.tines.com/oauth2/callback).
Note: There are other credentials we need to create first before we can save. Keep this tab open while you continue through this guide.
Create Azure application
Note: If you have already created an Azure application for your Microsoft Graph credential, you could skip the application setup portion and just edit the permissions to include the PowerBI scopes/permissions.
Otherwise, or if you would like to create a separate app for PowerBI, follow the next steps.
Navigate to app registrations in Azure. Give the app a name, select the your desired supported account types (“Single tenant only” was used in this example).
Note: The "Help me choose" option gives descriptions for the account types.
Under Redirect URI, select “Web” for platform type and paste the callback URL from Tines into the. Click “Register”.
Within your app, navigate to Manage > Certificates & secrets and click on the Client secrets tab.
Select “+ New client secret” to name and set expiration date. Note the expiration date for later. Click “Add” to generate a new secret.
Copy the secret value to use later in our Credential in Tines.
Navigate to API permissions and click on “+ Add a permission” then scroll down to select “Power BI Service” to add the relevant Power BI permissions.
Graph has two types of permissions: Delegated and application (see Power BI permissions).
In this example we will use delegated permissions.
Add the necessary scopes you will need for the types of operations that you will be doing. Usually, the scopes are listed in the API docs (example: Get Groups https://learn.microsoft.com/en-us/rest/api/power-bi/groups/get-groups)
Note the added scopes for later
Next, you may need to click “Grant admin consent” as an administrator for some or all permissions, i.e. application permissions and high-privilege delegated permissions (see consent).
Return to the overview section and copy the following for later:
Application (client) ID
Directory (tenant) ID
Select “Endpoints” in the Overview section and copy the following for later:
OAuth 2.0 authorization endpoint (v2) (example: https://login.microsoftonline.com/your-directory-tenant-id/oauth2/v2.0/authorize
OAuth 2.0 token endpoint (v2) (example: https://login.microsoftonline.com/your-directory-tenant-id/oauth2/v2.0/token)
Finish Creating Power BI Credential in Tines
Return to the credentials screen in Tines we left earlier in the guide.
1. OAuth 2.0 (Authorization Code Grant Type)
Paste Application (client) ID in Client ID field
Paste secret value into Client secret
Insert a space-separated list of scopes that match with the API permissions you selected in your Azure Application (example below) into Scope:
Set Grant type as Authorization code
Paste the OAuth authorization endpoint into the OAuth authorization request URL (example: https://login.microsoftonline.com/your-directory-tenant-id/oauth2/v2.0/authorize)
Paste the OAuth 2.0 token endpoint into the OAuth token URL (example: https://login.microsoftonline.com/your-directory-tenant-id/oauth2/v2.0/token)
PKCE challenge method: None
Paste the following in Domains separated by spaces:
api.powerbi.com login.microsoftonline.com
Optional
Set the teams this credential can be used in access and set expiry notifications recipient in expiry notifications.
Select save.
2. Save and then authorize Microsoft account.
3. Test with an HTTP request that is within your permissions (example Get Groups).
{"standardLibVersion":"87","actionRuntimeVersion":"71","agents":[{"disabled":false,"name":"Get Groups","description":"Returns a list of workspaces the user has access to.\n\nhttps://learn.microsoft.com/en-us/rest/api/power-bi/groups/get-groups","options":"{\"url\":\"https://api.powerbi.com/v1.0/myorg/groups\",\"method\":\"get\",\"headers\":{\"Authorization\":\"Bearer <<CREDENTIAL.powerbi>>\",\"Content-Type\":\"application/json\"}}","position":{"x":2415,"y":855},"type":"httpRequest","timeSavedUnit":"minutes","timeSavedValue":0,"monitorAllEvents":false,"monitorFailures":false,"monitorNoEventsEmitted":null,"aiMonitoringThresholds":[],"caseConfiguration":{"subStatus":null,"tags":[]},"recordType":null,"recordWriters":[],"form":null,"createdFromTemplateGuid":null,"createdFromTemplateVersion":null,"templateTags":[],"originStoryIdentifier":"cloud:c18f5f5beb294f638984cec56ebf3515:72a1c33baa387d031f0775fdd62e118d"}],"sections":[],"links":[],"diagramNotes":[]}