The Flask app uses python-jose-cryptodome to decode incoming Azure AD bearer tokens created using OAuth2 flows like auth code flow or client credential flow.
The Power BI custom connector uses auth_code flow for its AAD token.
-
Register an application in Azure AD and obtain the app_id and tenant_id. You'll also need to configure a redirect URL value of https://oauth.powerbi.com/views/oauthredirect.html
-
Add your app_id to pbi-connector/client_id as the only contents of that file
-
In pbi-connector/MyGraph.pq replace TENANT-ID with your tenant_id from Azure AD app registration
-
Modify flask-oauth-azure/.env with your tenant_id
-
You'll need Visual Studio + Power Query SDK to build the pbi-connector project
-
The Flask app runs in Docker... you can run it directly on your laptop, but whyyy
-
Run build.sh to build the Docker image
-
Run run.sh to run the image, the server is visible at http://localhost:5000. Use the /data secure endpoint to retrieve data
-
Build the pbi-connector project in Visual Studio and use F5 debugging to test it within VS