Main Feature. There are 5 btn in homepage
- Get list dataset
- Add new dataset
- Push data to table of dataset
- Popular data
- Clear data
Flow (when click one of btn):
- Check access token. If exist go to (2), else go to (4)
- Check access token expired or not. If not expired go to (3), else go to (6)
- Make http request to PoweBI API enpoint, show result to screen
- Redirect user to AD login page. After login success, go to (5)
- Save access token & refresh token to database. Then go to (3)
- Request new access token from PowerBI, using refresh token. If okay go to (5), else go to (4)
Prepare:
- TenantId -> this is ID of your AD
- ClientID, ClientSecret -> follow this: https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-register-a-client-app/
- Change UseSql in web.config = 0 to use memory local instead sql server
- ConnectionString -> database to store access & refresh token
Test:
- Go to https://nois-powerbiapi.azurewebsites.net
- Touch Red btn, to Clear AccessToken & RefreshToken
- Touch any blue btn, login with test@lyminhquan.com / X3wVUbxx
Check:
- Login to http://app.powerbi.com/ with test@lyminhquan.com / X3wVUbxx
- Check in My Workspaces -> DATASETS