Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Unable to use Managed Identity when calling Set-PnPAdaptiveScopeProperty #3808

Open
2 tasks done
hbland-cjc opened this issue Mar 5, 2024 · 3 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@hbland-cjc
Copy link

Reporting an Issue or Missing Feature

I am trying to build an Azure Function using Managed Identity that will receive a set of Values for some Adaptive Scope Properties we are trying to set as part of our workflow, however when running the Script we are seeing the error Unable to connect to the SharePoint Online Admin Center at 'https://{tenant}-admin.sharepoint.com' to run this cmdlet

Expected behavior

Set Adapative Scope Property to MyNewValue = Value1

Actual behavior

Unable to connect to the SharePoint Online Admin Center at 'https://{tenant}-admin.sharepoint.com' to run this cmdlet. If this URL is incorrect for your tenant, you can pass in the correct Admin Center URL using Connect-PnPOnline -TenantAdminUrl. If you are using Privileged Identity Management (PIM) on your tenant, please ensure you have activated at least the SharePoint Administrator role and allowed some time for it to activate. Error message: The remote server returned an error: (401) Unauthorized.

Steps to reproduce behavior

Connect-PnPOnline -Url $siteAddress -ManagedIdentity
Set-PnPAdaptiveScopeProperty -Key MyNewValue -Value Value1

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

'PnP.PowerShell' = '2.4.0'

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

  • Windows
  • Azure Functions
@hbland-cjc hbland-cjc added the bug Something isn't working label Mar 5, 2024
@gautamdsheth
Copy link
Collaborator

In your connect-pnponline cmdlet, can you please use https://tenant-admin.sharepoint.com site URL and try ?

@hbland-cjc
Copy link
Author

Hi @gautamdsheth,

Can you confirm how this will attach to an individual site when running the Set-PnPAdaptiveScopeProperty as this command doesn't have any way of setting which site we are editing?

@hbland-cjc
Copy link
Author

Hi @gautamdsheth,

I have tried your mentioned option however as queried in my original response this tries to make the change against the Tenant Admin portal not the site I am trying to apply the item to. Do you have any further suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants