sharepoint - 拒绝访问。您无权执行此操作或访问此资源设置属性包时
问题描述
我正在使用 azure ad 来获取共享点上下文,并在 Azure 函数中管理网站集。但是当我尝试设置属性包时,它失败了。我的天蓝色广告应用程序完全控制了网站权限。
Sites.FullControl.All
Application
Have full control of all site collections
Yes
using (ClientContext context = spHelper.GetAzureADOnlyClientContext(hostUrl, spAzureAppId, spTenant, certificate, false))
{
tenant.SetSiteAdmin(hostUrl, siteCreationInfo.TechnicalOwnerEmail, true);
admClientContext.ExecuteQuery();
string description = siteCreationInfo.Description;
if (!string.IsNullOrWhiteSpace(description))
{
//setting the propertyBag to flag the site created by CDA
context.Site.RootWeb.AllProperties["Createdby"] = "CDA-V0.5";
context.Site.RootWeb.Description = description;
context.Site.RootWeb.Update();
}
try
{
if (context.HasPendingRequest)
{
context.ExecuteQuery();
}
logHelper.writeLog("Site updated!");
}
catch (Exception ex)
{
logHelper.writeLog("Update site error:" + ex.Message);
throw;
}
}
我会错过更多设置吗?
解决方案
推荐阅读
- flutter - How to automatically scroll through all the ListTiles in the Listview.seperated in Flutter?
- python - 硒 err0r | 消息:“operadriver.exe”可执行文件需要在 PATH 中
- javascript - Android APK 找不到浏览器扩展
- c# - 如何使用c#重置datagridview
- vba - 在VBA中如何在网页上向下移动直到完成网页加载
- c++ - 使用 memcpy()
- reveal.js - 将reveal.js与asciidoc一起使用时,如何使用分步代码高亮?
- angular - 与 http.get - HttpClient - Angular 断开连接时可以替换 URL
- django - 上传后在 ImageField 中自动保存图像列表 - django 3
- amazon-web-services - 需要功能:[CAPABILITY_IAM] Cloudformation AWS 控制台