pnp / powershell

PnP PowerShell
https://pnp.github.io/powershell
MIT License
669 stars 344 forks source link

[BUG] Add-PnPEntraIDServicePrincipalAppRole no response #4317

Closed eddison-shyi closed 4 days ago

eddison-shyi commented 1 week ago

Reporting an Issue or Missing Feature

Get-PnPAzureADServicePrincipalAssignedAppRole & Add-PnPEntraIDServicePrincipalAppRole no response (Same with Azure CLI & Windows PowerShell 7), and after 30min it shows verification code expired error. (I've logged in successfully before calling these command) image

Expected behavior

Return the result immediately

Actual behavior

Idle until verification code expired

Steps to reproduce behavior

# Make sure ClientId app with proper permission for next command, e.g. AppRoleAssignment.ReadWrite.All and Application.Read.All
Connect-PnPOnline -Url ...  -DeviceLogin -ClientId ... -Tenant ...

# After login success
Add-PnPEntraIDServicePrincipalAppRole -Principal $AppID -AppRole "Sites.FullControl.All" -BuiltInType SharePoint

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

(you can retrieve this by executing Get-Module -Name "PnP.PowerShell" -ListAvailable) 2.12.0 on powershell 7.4.5 (windows)

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