I have a provisioning script which is run as a web job where i need to create a site collection app catalog and then add an app to it. I am storing information about the site in a sharepoint library which contains various xml, as well as the app. it then provisions the site successfully, creates the app catalog but no app inside. Checking the error logs it is stating that the file cannot be found.
I have the following code:
var appcat = web.SiteCollectionAppCatalog; var appManager = new AppManager(context); var path = https://tenant.sharepoint.com/sites/sitename/siteassets/appname.sppkg; var uploadApp = appManager.Add(path, true, OfficeDevPnP.Core.Enums.AppCatalogScope.Site); // This is where it errors saying file does not exist web.Update(); context.ExecuteQuery();
Is it possible to upload from a different sharepoint site? if so where am i going wrong, if not what would the alternatives be if it cannot be in local storage? Azure Storage?