Web API not able to create the pages in sharepoint tenant
Following code from WebAPI is not able to create a new web page in sharepoint site .... but same code works with console application. With latestes Pnp.framework 1.7 it stops executing at AddClientSidePage
`
public class ValuesController : ApiController
{
// GET api/values
public IEnumerable
using (var ctx = autheticationManager.GetACSAppOnlyContext(url, "client-id", "secret-key"))
{
Web web = ctx.Web;
ctx.Load(web.Lists);
ctx.Load(web, w => w.SupportedUILanguageIds);
ctx.Load(web);
ctx.ExecuteQueryRetry();
//Create the Page
var page2 = ctx.Web.AddClientSidePage(page, true);
// Not executing above statement ... no exception also....Browser page shows loading indicator in header .....
page2.AddSection(CanvasSectionTemplate.ThreeColumn, 5);
page2.AddSection(CanvasSectionTemplate.TwoColumn, 10);
page2.Save();
}
return new string[] { "value1", "value2" };
}
`
@rajeshpatil74 : can you provide a stack trace? What Azure function version are you using?
@rajeshpatil74 : can you provide a stack trace? What Azure function version are you using?
There is no stack trace / No exception. The code doesn't return back even after waiting for 2-3 min with Pnp.Framework 1.7.0.
With older pnp framework (SharePointPnPCoreOnline) which is deprecated now it is working.