ResourceNotFoundException on installing SPFx solution to app catalog on some tenants
Category
- [ ] Question
- [ ] Typo
- [x] Bug
- [ ] Additional article idea
Expected or Desired Behavior
The app package is uploaded and installed without an error
Observed Behavior
The app package is uploaded but not installed and an error appears
Add-PnPApp : {"error":{"code":"-1, Microsoft.SharePoint.Client.ResourceNotFoundException","message":{"lang":"en-US","value":"Exception of type 'Microsoft.SharePoint.Client.ResourceNotFoundException' was thrown."}}}
In the app catalog the 'App Package Error Message' contains the message: Error in the application.
Steps to Reproduce
Install the app package to the app catalog by either a manual upload or with PnP ALM cmdlets:
$url = "https://<customer>.sharepoint.com"
$creds = Get-Credential #Connect with SP admin account
Connect-PnPOnline -Url $url -Credentials $creds
$VerbosePreference = "Continue"
Add-PnPApp -Path "./ctb-user-management-web-parts.sppkg" -Scope Tenant -Debug -Overwrite
The app package contains an SPFx solution which uses Microsoft Graph permissions.
Also tried it with other solutions like the portal showcase from PnP Add-PnPApp -Path "./sharepoint-portal-showcase.sppkg" -Scope Tenant -Debug -Overwrite
On some tenants we managed to install the same app a couple days ago. Also updating the app on tenants where a previous version exists still works fine.
As the new Graph capabilities are in preview, that requires that your tenant is in "Targeted release mode" in the tenant scope. When you change this setting, it can take up to 24 hours for the setting to take effect. If your tenant is NOT set to be targeted release and you upload a package to app catalog with Graph scope definitions, you will get Error in the application exception.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues