microsoft / microsoft/powerbi-powershell
Permissions needed for Service Principal
Open
@CodeCyclone is already working on this.
Since Jul 19, 2018.
external bug
- Dominant language
- C#
- Stars
- 413
- Forks
- 134
- Avg merge
- 33m
- Merged PRs (30d)
- 1
Description
Is there a guide on how to create an Azure AD registered app (aka Service Principal) that has permissions to use these powershell commands?
I created an 'App Registration' in our Azure Active Directory.
I had our global admin grant it the 'Read and write all content in tenant' and 'View all content in tenant' permissions
I login successfully:
$tenantId = '<redacted>'
$applicationId = '<redacted>'
$key = '<redacted>'
$secureKey = ConvertTo-Securestring -String $key -AsPlainText -Force
$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $applicationId,$secureKey
Connect-PowerBIServiceAccount -ServicePrincipal -Credential $credential -Tenant $tenantId
Environment : Public
TenantId :
ClientId : <redacted>
Password : ********
But I get an unauthorized error from any of the commands:
PS> Get-PowerBIReport
Get-PowerBIReport : Operation returned an invalid status code 'Unauthorized'
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.