pnp / PnP-Sites-Core

Microsoft 365 Dev PnP Core component (.NET) targeted for increasing developer productivity with CSOM based solutions.
Other
416 stars 642 forks source link

[BUG] AppManager:GetAvailable() returns NULL after V3.23.2007 when used in Azure Functions #2813

Open matsla opened 3 years ago

matsla commented 3 years ago

For some reason the function to return available apps from tenant return NULL when used in an azure function after V 3.23.2007. It works fine using a console application, so it seems to be an issue with async handling when used in an azure function. Using Fiddler the call to AppManager:GetAvailable request to api/web/tenantappcatalog/AvailableApps returns all apps but the function returns NULL.

We use this functionally a lot of customer customizations and we are not able to update PnP to laster version due to this issue.

[FunctionName("TriggerTest")] public static async Task RunAsync([TimerTrigger("0 /2 *")]TimerInfo myTimer, TraceWriter log) {

  var authManager = new OfficeDevPnP.Core.AuthenticationManager();
  var ctx = authManager.GetSharePointOnlineAuthenticatedContextTenant(
   "https://xxxxx.sharepoint.com/sites/xxxxx",
   "xxxx",
   "yyyy");

  var appManager = new OfficeDevPnP.Core.ALM.AppManager(ctx);
  var apps = appManager.GetAvailable();

  // apps is NULL after V3.23.2007

}

Environment

[ X] Office 365 / SharePoint Online

ghost commented 3 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.