You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error when creating new Sharepoint group enabled site collection (first issue reported, hope I did everything right)
Steps to reproduce
When running the follwong code I get a graph exception, "{HttpResponseCode: 400Code: Request_BadRequestMessage: The value of 'odata.bind' property annotation is an empty array. The 'odata.bind' property annotation must have a non-empty array as its value.ClientRequestId
Code:
using (var pnpContext = await contextFactory.CreateAsync("SiteToWorkWith"))
{
var teamSiteToCreate = new TeamSiteOptions("mynewsite", "My new site")
{
Description = "My site description",
Visibility = PnP.Core.Model.Security.GroupVisibility.Public,
Owners = new string[] { "[email protected]" }
};
SiteCreationOptions siteCreationOptions = new SiteCreationOptions()
{
UsingApplicationPermissions = true
};
using (var newSiteContext = await pnpContext.GetSiteCollectionManager().CreateSiteCollectionAsync(teamSiteToCreate, siteCreationOptions))
{
// Do work on the created site collection via the newSiteContext
};
}
Expected behavior
A new group connected site collection to be created
Additional details: The more context you can provide, the easier it is (and therefore quicker) to help.
Additional context
My Entra ID app has application permssions on Microsoft.Graph
Group.Create
Group.ReadWrite.All
Sites.Fullcontrol.All
My Entra ID app has application permssions on SharePoint:
Sites.Fullcontrol.All
It works to create a non group enabled site collection:
var teamsite = new TeamSiteWithoutGroupOptions(new Uri(siteUrl), title.ToString())
{
Description = description.ToString(),
Language = PnP.Core.Admin.Model.SharePoint.Language.Swedish,
Owner = owner.ToString(),
Title = title.ToString(),
SensitivityLabelId = new Guid(azureFunctionSettings.SensitivityLabelIdSite)
};
//Get the context to the new site and perform additional config
using (var newSiteContext = await pnpContext.GetSiteCollectionManager().CreateSiteCollectionAsync(teamsiteBDO))
{
};
Thanks for all contributions to this SDK! It's great. Sharing is caring.
The text was updated successfully, but these errors were encountered:
Hi! I am the developer that took over @LarsThomasNilsson and the problem was on our end, our app had insufficient permissions for User.Read.All and Directory.Read.All in the Microsoft Graph-permissions in Azure.
Category
Error when creating new Sharepoint group enabled site collection (first issue reported, hope I did everything right)
Steps to reproduce
When running the follwong code I get a graph exception, "{HttpResponseCode: 400Code: Request_BadRequestMessage: The value of 'odata.bind' property annotation is an empty array. The 'odata.bind' property annotation must have a non-empty array as its value.ClientRequestId
Code:
using (var pnpContext = await contextFactory.CreateAsync("SiteToWorkWith"))
{
var teamSiteToCreate = new TeamSiteOptions("mynewsite", "My new site")
{
Description = "My site description",
Visibility = PnP.Core.Model.Security.GroupVisibility.Public,
Owners = new string[] { "[email protected]" }
};
}
Expected behavior
A new group connected site collection to be created
Environment details (development & target environment)
SDK version**: 1.14
OS: Windows 11
SDK used in:Console App
Framework: .NET 8.0
Tooling: Visual Studio 2022
Additional details: The more context you can provide, the easier it is (and therefore quicker) to help.
Additional context
My Entra ID app has application permssions on Microsoft.Graph
Group.Create
Group.ReadWrite.All
Sites.Fullcontrol.All
My Entra ID app has application permssions on SharePoint:
Sites.Fullcontrol.All
It works to create a non group enabled site collection:
var teamsite = new TeamSiteWithoutGroupOptions(new Uri(siteUrl), title.ToString())
{
Description = description.ToString(),
Language = PnP.Core.Admin.Model.SharePoint.Language.Swedish,
Owner = owner.ToString(),
Title = title.ToString(),
SensitivityLabelId = new Guid(azureFunctionSettings.SensitivityLabelIdSite)
};
//Get the context to the new site and perform additional config
using (var newSiteContext = await pnpContext.GetSiteCollectionManager().CreateSiteCollectionAsync(teamsiteBDO))
{
};
Thanks for all contributions to this SDK! It's great. Sharing is caring.
The text was updated successfully, but these errors were encountered: