On this weblog, I’ll share the steps which you could make the most of to entry PowerBI Admin API from service principal.
There are a lot of articles on the web about it however there may be combination of knowledge, so I’m simply documenting step-by-step that labored for us.
1. Register the APP in Azure AD and don’t ADD any API permissions (That is essential)
2. Create the Certificates and add the thumbprint to the APP.
Right here is the PowerShell command to do it.
New-SelfSignedCertificate -Topic ‘CN=DEVTESTCertificate’ -KeyLength 4096 -KeyUsageProperty All -KeyAlgorithm ‘RSA’ -HashAlgorithm ‘SHA256’ -Supplier ‘Microsoft Enhanced RSA and AES Cryptographic Supplier’ -NotAfter (Get-Date).AddYears(1)
Notice: Delete the certificates from machine context and add it to person context and disable the export of personal key.
Do safe the cert with non-public key in some secure vault.
3. Create Azure AD safety group as per naming conventions of you group and ADD the APP/Service Principal you created above as member of it.
4. Now login to powerBI Admin à Tenant Settings à Admin API Settings
Choose Service principals can entry read-only Admin APIs à Allow it.
Apply to Particular Safety Teams and Choose the above group you created.
5. Now obtain and set up PowerBI powershell modules
Set up-Module -Title MicrosoftPowerBIMgmt
6. Join the PowerBI using the ServicePrincipal.
Join-PowerBIServiceAccount -ServicePrincipal -CertificateThumbprint $thumbprint -ApplicationId $clientid -Tenant $tenantid
Now you’ll get linked and may run PowerShell instructions utilizing the service principal
Thanks for studying and downloading…
Tech Wizard