question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug report: Unable to deploy spfx app

See original GitHub issue

Description

Hello,

I am unable to add spfx package via m365 cli. I can get site details with m365 spo web get --webUrl $siteUrl Am I doing somethin wrong? Permissions are added and approved by global admin.

Steps to reproduce

m365 login --authType certificate --certificateBase64Encoded $base64 --password $password --appId $appid --tenant $tenantID
m365 spo app add -p $pathPackage --overwrite --scope sitecollection --appCatalogUrl $siteUrl

Expected results

App added

Actual results

node.exe : Error: Request failed with status code 403

Diagnostics

Request error: { “url”: “https://graph.microsoft.com/v1.0/sites/root?$select=webUrl”, “status”: 403, “statusText”: “Forbidden”, “headers”: { “transfer-encoding”: “chunked”, “content-type”: “application/json”, “vary”: “Accept-Encoding”, “strict-transport-security”: “max-age=31536000”, “request-id”: “d85ef4e3-c2d7-45a8-a7f3-b90405b2770f”, “client-request-id”: “d85ef4e3-c2d7-45a8-a7f3-b90405b2770f”, “x-ms-ags-diagnostic”: “{"ServerInfo":{"DataCenter":"West Europe","Slice":"E","Ring":"5","ScaleUnit":"005","RoleInstance":"AM4PEPF00015143"}}”, “date”: “Mon, 07 Mar 2022 21:08:29 GMT”, “connection”: “close” }, “error”: { “error”: { “code”: “AccessDenied”, “message”: “Either scp or roles claim need to be present in the token.”, “innerError”: { “date”: “2022-03-07T21:08:29”, “request-id”: “d85ef4e3-c2d7-45a8-a7f3-b90405b2770f”, “client-request-id”: “d85ef4e3-c2d7-45a8-a7f3-b90405b2770f” } } } } Error: Request failed with status code 403

CLI for Microsoft 365 version

v5.0.0

nodejs version

v14.17.6

Operating system (environment)

Windows

Shell

Windows PowerShell

cli doctor

{ “os”: { “platform”: “win32”, “version”: “Windows 10 Pro”, “release”: “10.0.19044” }, “cliVersion”: “5.0.0”, “nodeVersion”: “v14.17.6”, “cliAadAppId”: “a72e0e71-fff2-4b28-acf8-808422dd8ff9”, “cliAadAppTenant”: “single”, “authMode”: “Certificate”, “cliEnvironment”: “”, “cliConfig”: {}, “roles”: [ “User.Read.All”, “Sites.Manage.All”, “Sites.Read.All”, “Sites.FullControl.All” ], “scopes”: [] }

Additional Info

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
waldekmastykarzcommented, Mar 8, 2022

No problem. I’ll close this issue for now but if you ever get a chance to test it and could get back to us, I’d appreciate it.

1reaction
SergiyKostenkocommented, Mar 8, 2022

Unfortunatly, I am not able to test it right know. I don`t enough permissions to assign Microsoft Graph permissions to my app registration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SPFX webpart not added to site after deployment
I have developed a SPFx WebPart using react. When packaging this solution, I use the following commands: gulp clean gulp bundle --ship gulp...
Read more >
How build Team App using SharePoint SPFX webpart
I have a SPFX web part, working perfectly fine in SharePoint online sites. In App catalog site its syncing with Team successfully. I...
Read more >
Solve the 'Deployment failed' error in the app catalog
You see this error if you want to upload and deploy the 'sapiens.at.sharepoint.modernui.sppkg' app package to your tenant app catalog and you are...
Read more >
How to Deploy an App to App Catalog in SharePoint Online?
Apps (either SPFx .sppkg or Add-in .app file) to be uploaded and deployed there – is a prerequisite to use them in all...
Read more >
How To Deploy/Update/Upgrade Existing SPFx Webpart To ...
Go to the app catalog, upload your package. You should get the below screen. How To Deploy/Update/Upgrade Existing SFx Webpart To Microsoft Team....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found