power bi and powershell - microsoft€¦ · you can still use the power bi mgmt module. photo by...
TRANSCRIPT
![Page 1: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/1.jpg)
Power BI and PowerShellA Match Made in HeavenCraig Porteous
![Page 2: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/2.jpg)
Craig Porteous
https://craigporteous.com
@cporteous
https://github.com/cporteou
https://www.linkedin.com/in/craigporteous/
Data Engineer @ Incremental Group
Worked in BI with the Microsoft stack for more than 10 years.
SQL Glasgow UG co-leader. DATA:Scotland Founder. Microsoft Data Platform MVP
![Page 3: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/3.jpg)
![Page 4: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/4.jpg)
▪Why do we need to manage Power BI?
▪What can we do with PowerShell?
▪API vs PowerShell Module(s);
▪Not an admin? There are still options;
▪Put it into practice.
What we’ll cover
Photo by Glenn Carstens-Peters on Unsplash
![Page 5: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/5.jpg)
Why do we need to manage Power BI?
Error Handling
Control Security
Manage Content
Data
![Page 6: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/6.jpg)
The Power BI Admin Portal
App Engagement info
Organisation level settings
Content Management
![Page 7: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/7.jpg)
What can we do with PowerShell?
Control and audit Permissions
Refresh datasets and view history
Manage Workspaces, Reports, Datasets etc
Track User and Tenant Licenses
Circumvent license restrictions ;)
Au
tom
atio
n
![Page 8: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/8.jpg)
API vs PowerShell Modules
Azure PowerShell Modules• msOnline (v1)• AzureAD (v2)
REST API
Power BI REST API• Using Invoke-RESTMethod• MicrosoftPowerBIMgmt
![Page 9: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/9.jpg)
DEMO
![Page 10: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/10.jpg)
Apps
Data Sources
Dataflows
Groups
Datasets Reports DashboardsGatewaysOn-Premises
Data Sources
Permissions
Features Capacity
Get TablesDeleteRefresh HistoryRefresh datasetEtc…Create
DeleteUpdate
Etc…
Get infoUpdate
Get infoAdd UserDelete UserEtc…
CreateDeleteAdd UserDelete UserEtc…
AddGet infoGet TileClone Tile
Get infoCloneDeleteEtc…
Get InfoAssign Workspace
Get info
https://docs.microsoft.com/en-us/rest/api/power-bi/
REST API Capabilities
Get AppGet DashboardsGet Reports Etc…
Get infoDelete
RefreshEtc…
![Page 11: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/11.jpg)
DEMO
![Page 12: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/12.jpg)
What can’t we do with PowerShell
Read Data
Create Dashboards
Publish or Update Apps
Author Reports
![Page 13: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/13.jpg)
Not an admin?
All is not lost!▪Restricted to Workspaces you are
a member of;
▪Read and start dataset refreshes;
▪View and update security*;
▪Track user and tenant licenses;
▪You can still use the Power BIMgmt module.
Photo by Matthew Garoffolo on Unsplash
![Page 14: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/14.jpg)
▪Authentication options;
▪Prerequisites to automation;
▪Create and update a dataset entirely in PowerShell.
Piecing it all together
Photo by Adam Birkett on Unsplash
![Page 15: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/15.jpg)
Prompted Authentication
MicrosoftPowerBIMgmt
Power BI
CodeData
Auth
![Page 16: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/16.jpg)
Unattended Authentication
AppAuth Token
Power BIAzure
CodeData
PowerBI-MetadataSecure String or
Credential Manager
OR
![Page 17: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/17.jpg)
Service Principals
App
Workspace*Power BI
*This authentication method only works with v2 workspaces
Auth Token
Power BI
CodeData
Requires:Power BI AdminAD Group for Service Principal
![Page 18: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/18.jpg)
DEMO
![Page 19: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/19.jpg)
▪But…
▪Unattended Authentication isn’t “Official”;
▪2FA is not compatible with unattended auth;
▪Automation isn’t simple ….yet!
▪The API is always evolving;
▪Modules are a work in progress – Contribute!
PowerShell ‘s Power BI
![Page 20: Power BI and PowerShell - Microsoft€¦ · You can still use the Power BI Mgmt module. Photo by Matthew Garoffolo on Unsplash Authentication options; Prerequisites to automation;](https://reader031.vdocuments.mx/reader031/viewer/2022040606/5eae15e9db2ae64c9378c181/html5/thumbnails/20.jpg)
Questions?
https://github.com/cporteou/Presentations
Photo by Matt Jones on Unsplash