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] There is an issue in pnp framework that if it is in an app-only context and we have the access token, then it uses Microsoft Graph, but it ignores PreferredDataLocation at CreateTeamSiteViaGraphAsync #271

Closed
5 tasks
svermaak opened this issue Apr 8, 2021 · 4 comments · Fixed by #278
Assignees
Labels
area: provisioning ⚙ Provisioning engine issue or pull request backlog New feature or request

Comments

@svermaak
Copy link

svermaak commented Apr 8, 2021

Reporting an Issue or Missing Feature

Bug

Expected behavior

Site created within the correct Geo Tenant

Actual behavior

Site created in home tenant

Steps to reproduce behavior

reating a site with a preferredDataLocation usign REST works

Connect-PnPOnline -Url <admin site url> -ClientId <ClientId> -Tenant <tenantid> -Thumbprint <Thumbprint>

$accessToken = Get-PnPGraphAccessToken 
$header = @{ Authorization = "Bearer $($accessToken)"}         

$uri = https://graph.microsoft.com/v1.0/groups

$body = @{"displayName"="Test"; 
          "mailEnabled"=$false; 
          "groupTypes"=@("Unified"); 
          "securityEnabled"=$false; 
          "mailNickname"="ps1";
          "preferredDataLocation"="NAM"
    } | ConvertTo-Json

$response = Invoke-RestMethod –Uri $uri –Headers $header –Method Post –ContentType "application/json" -Body $body

Using New-PnPSite with an account works but using New-PnPSite with an App ID does not create site in GEO tenant even by connecting to GEO tenant and/or using -PreferredDataLocation

It seems that PreferredDataLocation is ignored in CreateTeamSiteViaGraphAsync

Also, it seems that the PreferredDataLocation parameter disappear at some point

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

1.5

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

  • [x ] Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify
@gautamdsheth gautamdsheth self-assigned this Apr 9, 2021
@erwinvanhunen erwinvanhunen transferred this issue from pnp/powershell Apr 9, 2021
@jansenbe jansenbe added area: provisioning ⚙ Provisioning engine issue or pull request backlog New feature or request labels Apr 19, 2021
@jansenbe jansenbe self-assigned this Apr 19, 2021
@jansenbe
Copy link
Contributor

jansenbe commented Apr 19, 2021

@svermaak / @gautamdsheth / @erwinvanhunen : the PDL is indeed not passed along the PnP Framework API calls. Something that can be fixed...adding this to our backlog as we're swamped with work, if you would be able to create a PR that would speed up the delivery of this.

@gautamdsheth
Copy link
Collaborator

@jansenbe - working on it :)

@jansenbe
Copy link
Contributor

@svermaak : this has been fixed for PnP Framework. @gautamdsheth can let you know if there's additional work needed in PS, if not this should now work with the next set of nightly releases we create

@svermaak
Copy link
Author

Thank you Guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: provisioning ⚙ Provisioning engine issue or pull request backlog New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants