powershell icon indicating copy to clipboard operation
powershell copied to clipboard

[BUG] No SharePoint context for connections authenticated with Managed Identity

Open sergeyz7 opened this issue 5 years ago • 3 comments

Notice

Many bugs reported are actually related to the PnP Framework which is used behind the scenes. Consider carefully where to report an issue:

  1. Are you using Invoke-PnPSiteTemplate or Get-PnPSiteTemplate? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/pnp/pnpframework/issues.
  2. Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.
  3. If you think that the functionality might be related to the underlying libraries that the cmdlet is calling (We realize that might be difficult to determine), please first double check the code of the cmdlet, which can be found here: https://github.com/pnp/powershell/tree/master/src/Commands. If related to the cmdlet, continue reporting the issue here, otherwise report the issue at https://github.com/pnp/pnpframework/issues

Reporting an Issue or Missing Feature

Authenticating with a Managed Identity from either Cloud Shell or an Azure Function results in a token with no SharePoint context, so none of the SharePoint cmdlets work. Graph-using cmdlets (such as -PnPTeams) work as expected. The only audience in the token is https://graph.microsoft.com/.

Expected behavior

Being able to access SharePoint Online objects.

Actual behavior

CloudShellPnP

Steps to reproduce behavior

Connect-PnPOnline -ManagedIdentity Get-PnPContext

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

1.5.0

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

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

sergeyz7 avatar Apr 30 '21 17:04 sergeyz7

Managed Identity is not supported for SharePoint, so these commands won’t work.

gautamdsheth avatar Apr 30 '21 18:04 gautamdsheth

@gautamdsheth - Will that be an enhancement at some stage or it's depending on MSFT? Because the issue can be closed if there's nothing we can do at this point.

veronicageek avatar May 04 '21 17:05 veronicageek

@veronicageek / @sergeyz7 - It's depending on MSFT , so nothing we can do here. So, closing this.

gautamdsheth avatar May 05 '21 12:05 gautamdsheth