Skip to content

Connect-PowerBIServiceAccount with certificate authentication behaves differently in PS 7 vs PS 5.1 #428

@blucier69

Description

@blucier69

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

  1. Cert with private key installed in LocalMachine\My; HasPrivateKey=True
  2. Public cert uploaded to App Registration; matching thumbprint
  3. App is single-tenant in tenant X; client secret auth works
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions