Manage SharePoint Framework (SPFx) solutions and SharePoint Add-ins through the tenant or site collection app catalog.
All operations target the tenant app catalog (admin.web.tenant_app_catalog).
Install/uninstall also affect a target site.
| Requirement | Description | Reference |
|---|---|---|
| Tenant App Catalog | A site collection app catalog must exist in the tenant. | Use App Catalog |
| SharePoint Administrator or Site Owner role (on the target site) | Required to upload, deploy, install, and uninstall apps. | SharePoint admin role |
| .sppkg or .app file | A packaged SPFx solution or SharePoint Add-in. |
flowchart LR
Upload --> Deploy --> Install --> Use
Upload -.->|skip deploy| Remove
Install -.-> Uninstall --> Remove
| Step | Operation | File | Required role | API reference |
|---|---|---|---|---|
| 1 | Upload — add .sppkg to the app catalog |
upload_app.py |
Site Owner on app catalog | Upload |
| 2 | List — enumerate apps in the catalog | list_apps.py |
Read access | List |
| 3 | Inspect — get app metadata and upgrade info | inspect_app.py |
Read access | Get details |
| 4 | Deploy — enable an app for installation | deploy_app.py |
Site Owner on app catalog | Deploy |
| 5 | Install — install app on a target site | install_app.py |
Site Owner on target site | Install |
| 6 | Upgrade — deploy a newer version and install | upgrade_app.py |
Both from steps 4-5 | Upgrade |
| 7 | Uninstall — remove app from a target site | uninstall_app.py |
Site Owner on target site | Uninstall |
| 8 | Remove — delete app from the catalog | remove_app.py |
Site Owner on app catalog | Remove |
from office365.sharepoint.client_context import ClientContext
ctx = ClientContext("https://contoso.sharepoint.com/sites/appcatalog").with_client_secret(
"contoso.onmicrosoft.com", "client_id", "client_secret"
)
# List apps in the app catalog
apps = ctx.web.app_catalog.get().execute_query()
for app in apps:
print(f" {app.title} (ID: {app.id})")