Skip to content

newoceaninfosys/powerbiapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PowerBI api project

Main Feature. There are 5 btn in homepage

  1. Get list dataset
  2. Add new dataset
  3. Push data to table of dataset
  4. Popular data
  5. Clear data

Flow (when click one of btn):

  1. Check access token. If exist go to (2), else go to (4)
  2. Check access token expired or not. If not expired go to (3), else go to (6)
  3. Make http request to PoweBI API enpoint, show result to screen
  4. Redirect user to AD login page. After login success, go to (5)
  5. Save access token & refresh token to database. Then go to (3)
  6. Request new access token from PowerBI, using refresh token. If okay go to (5), else go to (4)

Prepare:

  1. TenantId -> this is ID of your AD
  2. ClientID, ClientSecret -> follow this: https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-register-a-client-app/
  3. Change UseSql in web.config = 0 to use memory local instead sql server
  4. ConnectionString -> database to store access & refresh token

Test:

  1. Go to https://nois-powerbiapi.azurewebsites.net
  2. Touch Red btn, to Clear AccessToken & RefreshToken
  3. Touch any blue btn, login with test@lyminhquan.com / X3wVUbxx

Check:

  1. Login to http://app.powerbi.com/ with test@lyminhquan.com / X3wVUbxx
  2. Check in My Workspaces -> DATASETS