Skip to content

[BUG] Get-PnPAzureADUser not working anymore in 2.10.0 #4216

@RobinDijkstra

Description

@RobinDijkstra

Reporting an Issue or Missing Feature

After upgrading to 2.10.0, the cmdlet Get-PnPAzureADUser is giving an error. Downgrading to 2.9.0 resolves the issue.

Expected behavior

No error after upgrade.

Actual behavior

The cmdlet gives the following error:
OUTPUT: Error: AADSTS1002012: The provided value for scope User.Read.All is not valid. Client credential flows must have a scope value with /.default suffixed to the resource identifier (application ID URI). Trace ID: c7c52944-7c74-4cf2-9319-7b2114764b00 Correlation ID: d77c02ec-4fec-4bb2-9128-2ba1db41866d Timestamp: 2024-08-30 09:30:20Z

Steps to reproduce behavior

I'm running a powershell script in an Azure Function. Relevant code:

$c = Connect-PnPOnline -Url $TenantAdminUrl -Tenant $TenantDomain -ClientId $ClientId -Thumbprint $CertificateThumbprint -ReturnConnection
$user = Get-PnPAzureADUser -Filter "UserPrincipalName eq '$userId'" -Select "AssignedPlans" -Connection $c

What is the version of the Cmdlet module you are running?

2.10.0

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Additional information:
Running in an Azure Function, in requirements.psd1 I had 'PnP.PowerShell' = '2.*'. Therefore there was automatically an upgrade to 2.10.0 in the last few days, after which every run of the function gave the error. Changing requirements.psd1 to 'PnP.PowerShell' = '2.9.0' (and adding Import-Module PnP.PowerShell -RequiredVersion '2.9.0' to profile.ps1) all runs ended without errors again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions