Skip to content

[BUG] 401 Unauthorized error when executing Register-PnPHubSite command for a satellite geo site in a multi-geo environment #920

Description

@yoinuma

Reporting an Issue or Missing Feature

I get an error when I do Register-PnPHubSite with Satellite Geo.
The command is executed as follows.
image

The app specified in -ClientId is pre-registered in Azure AD, and the "Sites.FullControl.All" API permission is assigned to the app.
image

For the same satellite geo, command Get-PnPTenantSite succeeds.
For the central geo, the command Register-PnPHubSite succeeds.

Expected behavior

The Register-PnPHubSite command should succeed without error.

Actual behavior

The Register-PnPHubSite command fails with 401 Unauthorized.

Steps to reproduce behavior

  1. Create a multi-geo tenant and create a satellite geo within it.
  2. Create a communication site within the satellite tenant.
  3. Create Azure AD application and assign "Sites.FullControl.All" right to the app
    https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal
  4. Run the Connect-PnPOnline and Register-PnPHubSite commands with the same options as in the screenshot at the top.

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

1.5.0 and 1.6.0

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions