microsoft / microsoft/powerbi-powershell
Connect-PowerBIServiceAccount with certificate authentication behaves differently in PS 7 vs PS 5.1
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 413
- Forks
- 134
- Avg merge
- 33m
- Merged PRs (30d)
- 1
Description
Similar to issue #411
Environment
- OS: Windows 10/11/Server (build)
- PowerShell: 7.x (pwsh) + Windows PowerShell 5.1 (comparison)
- VS Code: 1.xx.x (if applicable)
- MicrosoftPowerBIMgmt: (from Get-Module -ListAvailable)
- MSAL/Identity bits: if present in $PSModulePath (optional)
Repro
- Cert with private key installed in LocalMachine\My; HasPrivateKey=True
- Public cert uploaded to App Registration; matching thumbprint
- App is single-tenant in tenant X; client secret auth works
- Run (PS 7):
Connect-PowerBIServiceAccount -ServicePrincipal -Tenant
-ApplicationId -CertificateThumbprint -Verbose
Expected: Token acquired (as in PS 5.1)
Actual: Error Acquiring Token: unauthorized_client / AADSTS700016 ... directory 'Microsoft Services'
Notes
- The same parameters succeed in Windows PowerShell 5.1
- Client secret flow succeeds in PS 7
- Resolve-PowerBIError output attached below
- Issue appears specific to certificate parameter set in PS 7
Logs
- Output of: Resolve-PowerBIError -Last
- Output of: Get-Command Connect-PowerBIServiceAccount -Syntax
- Output of: Get-Module MicrosoftPowerBIMgmt* -ListAvailable
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.
Research direction
Start with the Connect-PowerBIServiceAccount certificate parameter set and reproduce the difference in PowerShell 7 and Windows PowerShell 5.1. Collect the exact MicrosoftPowerBIMgmt and MSAL/Identity versions, then compare Resolve-PowerBIError -Last output and the command syntax. Done means certificate authentication acquires a token in PowerShell 7 for the same tenant and application.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100