pnp / powershell

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

Required Authorization/Connection Type to utilize this function #682

Closed jarvann closed 3 years ago

jarvann commented 3 years ago

Reposting in "correct" repository from original: https://github.com/MicrosoftDocs/office-docs-powershell/issues/7740

When I try to access the Add-PnPTeamsTeam function through an Azure Function using:

Connect-PnPOnline -Tenant [tenant].onmicrosoft.com -ClientId [appid] -Thumbprint [thumbprint] -Url https://[tenant].sharepoint.com

I get the following error: image

I am wondering if the Doc needs updating to specify which connection methods are permitted, or if the function needs to be updated to allow for "Application" API permissions to execute it.

Any Help appreciated, Thanks!

veronicageek commented 3 years ago

Does it work without the Azure Function?

jarvann commented 3 years ago

Does it work without the Azure Function? I can't remember, I will try again on Monday.

gautamdsheth commented 3 years ago

Yeah, certificate auth is not supported for that cmdlet.

@veronicageek / @jarvann - should we update docs for this ? or also update the cmdlet as well to warn users ?

jarvann commented 3 years ago

should we update docs for this ? or also update the cmdlet as well to warn users ?

I think both is the right answer. If you have a known "negative" path, it should be checked (if possible) and reported prior to throwing an exception. In addition, the documentation would help, especially if it can explain the "why" for not using certificate AuthN.

Personally, I feel that utilizing Azure Function with "App Registration"/Service credentials is a valid use case. So I would be curious at which point in the call chain would require an update to make that happen? Is it an API permission problem on the AAD side, an issue in the MS Teams cmdlets/API, or is it the PnP Scripts that are preventing this from working?

For now, I am satisfied if the documentation and scripts could be aligned with the existing capabilities.

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days

gautamdsheth commented 3 years ago

@jarvann - we fixed this issue couple of days back. Can you please try with the latest nightly builds ? Please reopen this if it still happens. Thanks for reporting !