Pnp-powershell: Not able to create new site collection using AppId Secret ,getting error "App-Only is currently not supported"

Created on 16 Jan 2019  路  6Comments  路  Source: pnp/PnP-PowerShell

Reporting an Issue or Missing Feature

Not able to create new site collection using AppId Secret ,getting error "App-Only is currently not supported"

Expected behavior

New sitecollection should create using client id secret

Actual behavior

Please describe what you see instead. Please provide samples of HTML output or screenshots
image

Steps to reproduce behavior

1. assign client id,secret and application url to corresponding variables:
$clientId ="YourClientID"
$clientSecret ="YourClient Secret"
$Url="https://rootsite.sharepoint.com"

2. connect to the webapplication using client id secret:
Connect-PnPOnline -AppId $clientId -AppSecret $clientSecret -Url $url

3. Create new site colletion using "New-PnPSite"
New-PnPSite -Type TeamSite -Title "siteTitle" -Alias "siteAlias"

Which version of the PnP-PowerShell Cmdlets are you using?

  • [ ] PnP PowerShell for SharePoint Online

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

SharePointPnPPowerShellOnline

How did you install the PnP-PowerShell Cmdlets?

  • [ ] MSI Installed downloaded from GitHub
  • [ ] Installed through the PowerShell Gallery with Install-Module

Most helpful comment

I think the fix mentioned on the 13th of june is only applicable on the modern sites without a Group/Team connected to it and not on the modern Teamsites with a Group/Team connection, they are
created using different REST api's on the background, the /_api/GroupSiteManager/CreateGroupEx still doesn't support App-only unfortunately.

All 6 comments

This is not a PnP issue per se. The underlying APIs we use to provision Modern team sites backed by O365 group dont allow provisioning with App-only credentials.

It will work with user credentials. Ensure that you are a Global Admin as well.

Connect-PnPOnline 鈥揢rl https://tenant.sharepoint.com 鈥揅redentials (Get-Credential)

After that you can use the New-PnPSite commandlet to provision the modern team site.

@gautamdsheth : Yes gautam . I have already created my sitecollection using user credential. but my requirment is not with user account that is why i didn't mention about that in my issue.

I have to create site using app id secret as we are doing earlier in sharepoint.
Please suggest me on same and if it is not possible then please comment on that with the exact microsoft terms

At 13 juni the uservoice item has been marked as 'Boom! It's done'.

Can we have a timeline when we will be able to use this feature in pnp? Is this days/weeks/months?

Given that the upstream issue in the Sharepoint API was corrected on June 13, 2019 are there changes still required to support it in the Sharepoint PnP Powershell module? Is this work planned?

I think the fix mentioned on the 13th of june is only applicable on the modern sites without a Group/Team connected to it and not on the modern Teamsites with a Group/Team connection, they are
created using different REST api's on the background, the /_api/GroupSiteManager/CreateGroupEx still doesn't support App-only unfortunately.

Was this page helpful?
0 / 5 - 0 ratings