Skip to content

Commit f256ae2

Browse files
committed
Adding notes on the site collection app catalog ALM API support
1 parent 262796d commit f256ae2

File tree

1 file changed

+38
-35
lines changed

1 file changed

+38
-35
lines changed

docs/apis/alm-api-for-spfx-add-ins.md

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Application Lifecycle Management (ALM) APIs
33
description: ALM APIs provide simple APIs to manage deployment of your SharePoint Framework solutions and add-ins across your tenant.
4-
ms.date: 02/08/2018
4+
ms.date: 04/06/2018
55
ms.prod: sharepoint
66
ms.assetid: fdf7ecb2-8851-425b-b058-3285fba77b68
77
---
@@ -10,30 +10,30 @@ ms.assetid: fdf7ecb2-8851-425b-b058-3285fba77b68
1010

1111
ALM APIs provide simple APIs to manage deployment of your SharePoint Framework solutions and add-ins across your tenant. ALM APIs support the following capabilities:
1212

13-
- Add SharePoint Framework solution or SharePoint Add-in to tenant app catalog.
14-
- Remove SharePoint Framework solution or SharePoint Add-in from tenant app catalog.
15-
- Enable SharePoint Framework solution or SharePoint Add-in to be available for installation in tenant app catalog.
16-
- Disable SharePoint Framework solution or SharePoint Add-in not to be available for installation in tenant app catalog.
17-
- Install SharePoint Framework solution or SharePoint Add-in from tenant app catalog to a site.
18-
- Upgrade SharePoint Framework solution or SharePoint Add-in to a site, which has a newer version available in the tenant app catalog.
13+
- Add SharePoint Framework solution or SharePoint Add-in to tenant or site collection app catalog.
14+
- Remove SharePoint Framework solution or SharePoint Add-in from tenant or site collection app catalog.
15+
- Enable SharePoint Framework solution or SharePoint Add-in to be available for installation in tenant or site collection app catalog.
16+
- Disable SharePoint Framework solution or SharePoint Add-in not to be available for installation in tenant or site collection app catalog.
17+
- Install SharePoint Framework solution or SharePoint Add-in from tenant or site collection app catalog to a site.
18+
- Upgrade SharePoint Framework solution or SharePoint Add-in to a site, which has a newer version available in the tenant or site collection app catalog.
1919
- Uninstall SharePoint Framework solution or SharePoint Add-in from the site.
20-
- List all and get details about SharePoint Framework solutions or SharePoint Add-ins in the tenant app catalog.
20+
- List all and get details about SharePoint Framework solutions or SharePoint Add-ins in the tenant or site collection app catalog.
2121

2222
ALM APIs can be used to perform exactly the same operations that are available from a UI perspective. When these APIs are used, all typical actions are performed. Following are some of the characteristics of ALM APIs:
2323

2424
- `Install` and `UnInstall` events are being fired for provider-hosted add-ins when corresponding operations occur.
2525
- ALM APIs support app-only-based operations.
2626

27-
ALM APIs are natively provided by using REST APIs, but there are additional CSOM extensions, PowerShell cmdlets, and the cross-platform Office 365 CLI available through SharePoint Patterns and Practices.
28-
29-
> [!NOTE]
30-
> ALM APIs are not currently supported for the [site collection app catalog](../general-development/site-collection-app-catalog.md). Support will be added in early 2018.
27+
ALM APIs are natively provided by using REST APIs, but there are additional CSOM extensions, PowerShell cmdlets, and the cross-platform Office 365 CLI available through SharePoint PnP Community channels.
3128

3229
## REST API
3330

34-
### Add solution package to the tenant app catalog
31+
> [!TIP]
32+
> ALM APIs are also supported for the [site collection app catalog](../general-development/site-collection-app-catalog.md). URLs for the site collection app catalog operations are exactly the same, but you can change the `tenantappcatalog` as `sitecollectionappcatalog`. Notice also that you will need to enable site collection app catalog in your site collection or you will get an exception when trying to use these APIs.
33+
34+
### Add solution package to the app catalog
3535

36-
This API is designed to be executed in the context of the tenant app catalog site.
36+
This API is designed to be executed in the context of the app catalog site.
3737

3838
```
3939
url: /_api/web/tenantappcatalog/Add(overwrite=true, url='test.txt')
@@ -45,9 +45,9 @@ binaryStringRequestBody: true
4545
body: 'byte array of the file'
4646
```
4747

48-
### Deploy solution packages in the tenant app catalog
48+
### Deploy solution packages in the app catalog
4949

50-
This enables the solution to be available to install to specific sites. This API is designed to be executed in the context of the tenant app catalog site.
50+
This enables the solution to be available to install to specific sites. This API is designed to be executed in the context of the app catalog site.
5151

5252
```
5353
url: /_api/web/tenantappcatalog/AvailableApps/GetById('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx')/Deploy
@@ -61,9 +61,9 @@ Content-Type: 'application/json;odata=nometadata;charset=utf-8'
6161
> [!NOTE]
6262
> This operation is required to be completed after Add, before you can install packages to specific sites.
6363
64-
### Retract solution packages in the tenant app catalog
64+
### Retract solution packages in the app catalog
6565

66-
This retracts the solution to be available from the sites. This API is designed to be executed in the context of the tenant app catalog site.
66+
This retracts the solution to be available from the sites. This API is designed to be executed in the context of the app catalog site.
6767

6868
```
6969
url: /_api/web/tenantappcatalog/AvailableApps/GetById('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx')/Retract
@@ -76,9 +76,9 @@ Accept: 'application/json;odata=nometadata'
7676
> [!NOTE]
7777
> If you run this operation after you have installed solutions to the site, they stop working because the solution is disabled from the tenant level.
7878
79-
### Remove solution packages from the tenant app catalog
79+
### Remove solution packages from the app catalog
8080

81-
This API is designed to be executed in the context of the tenant app catalog site.
81+
This API is designed to be executed in the context of the app catalog site.
8282

8383
```
8484
url: /_api/web/tenantappcatalog/AvailableApps/GetById('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx')/Remove
@@ -90,9 +90,9 @@ Accept: 'application/json;odata=nometadata'
9090
> [!NOTE]
9191
> If the Retract operation is not performed before the Remove operation, the solution is automatically retracted.
9292
93-
### List available packages from the tenant app catalog
93+
### List available packages from the app catalog
9494

95-
Use this REST API for getting a list of available SharePoint Framework solutions or add-ins in the tenant app catalog.
95+
Use this REST API for getting a list of available SharePoint Framework solutions or add-ins in the app catalog.
9696

9797
```
9898
url: /_api/web/tenantappcatalog/AvailableApps
@@ -101,9 +101,9 @@ Authorization: Bearer <access token>
101101
Accept: 'application/json;odata=nometadata'
102102
```
103103

104-
### Get details about individual solution packages in the tenant app catalog
104+
### Get details about individual solution packages in the app catalog
105105

106-
Use this REST API for getting details about individual SharePoint Framework solutions or add-ins available in the tenant app catalog.
106+
Use this REST API for getting details about individual SharePoint Framework solutions or add-ins available in the app catalog.
107107

108108
```
109109
url: /_api/web/tenantappcatalog/AvailableApps/GetById('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx')
@@ -112,9 +112,9 @@ Authorization: Bearer <access token>
112112
Accept: 'application/json;odata=nometadata'
113113
```
114114

115-
### Install solution package from the tenant app catalog to a SharePoint site
115+
### Install solution package from the app catalog to a SharePoint site
116116

117-
Install a solution package with a specific identifier from the tenant app catalog to the site based on URL context. This REST call can be executed in the context of the site where the install operation should happen.
117+
Install a solution package with a specific identifier from the app catalog to the site based on URL context. This REST call can be executed in the context of the site where the install operation should happen.
118118

119119
```
120120
url: /_api/web/tenantappcatalog/AvailableApps/GetById('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx')/Install
@@ -126,7 +126,7 @@ Accept: 'application/json;odata=nometadata'
126126

127127
### Upgrade solution packages on the SharePoint site
128128

129-
Upgrade a solution package from the site to a newer version available in the tenant app catalog. This REST call can be executed in the context of the site where the upgrade operation should happen.
129+
Upgrade a solution package from the site to a newer version available in the app catalog. This REST call can be executed in the context of the site where the upgrade operation should happen.
130130

131131
```
132132
url: /_api/web/tenantappcatalog/AvailableApps/GetById('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx')/Upgrade
@@ -155,17 +155,20 @@ Accept: 'application/json;odata=nometadata'
155155

156156
By using [PnP PowerShell](https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-pnp/sharepoint-pnp-cmdlets?view=sharepoint-ps), you can automate deploying, publishing, installing, upgrading, and retracting your apps.
157157

158+
> [!NOTE]
159+
> Support for scope option was released on the April 2018 release of PnP PowerShell.
160+
158161
### Add and publish your app to the app catalog
159-
Adding your app (.sppkg file, .app file) to the tenant app catalog is a prerequisite to making your app available for use on your SharePoint sites. You can do this by using the following cmdlet:
162+
Adding your app (.sppkg file, .app file) to the app catalog is a prerequisite to making your app available for use on your SharePoint sites. You can do this by using the following cmdlet:
160163

161164
```PowerShell
162-
Add-PnPApp -Path ./myapp.sppkg
165+
Add-PnPApp -Path ./myapp.sppkg -Scope Tenant
163166
```
164167

165168
Once added, you need to continue with publishing your app, effectively making the app available to be used by the users of your tenant. The following PnP PowerShell cmdlet shows how this can be done:
166169

167170
```PowerShell
168-
Publish-PnPApp -Identity <app id> -SkipFeatureDeployment
171+
Publish-PnPApp -Identity <app id> -SkipFeatureDeployment -Scope Tenant
169172
```
170173

171174

@@ -179,7 +182,7 @@ Publish-PnPApp -Identity <app id> -SkipFeatureDeployment
179182
To remove an app added earlier, use the following cmdlet:
180183

181184
```PowerShell
182-
Remove-PnPApp -Identity <app id>
185+
Remove-PnPApp -Identity <app id> -Scope Tenant
183186
```
184187

185188

@@ -188,20 +191,20 @@ Remove-PnPApp -Identity <app id>
188191
After the app is added to the app catalog and published, you can install the app to your site:
189192

190193
```PowerShell
191-
Install-PnPApp -Identity <app id>
194+
Install-PnPApp -Identity <app id> -Scope Tenant
192195
```
193196

194197

195198
To upgrade the app:
196199

197200
```PowerShell
198-
Update-PnPApp -Identity <app id>
201+
Update-PnPApp -Identity <app id> -Scope Tenant
199202
```
200203

201204
To uninstall the app from your site:
202205

203206
```PowerShell
204-
Uninstall-PnPApp -Identity <app id>
207+
Uninstall-PnPApp -Identity <app id> -Scope Tenant
205208
```
206209

207210

@@ -215,7 +218,7 @@ Uninstall-PnPApp -Identity <app id>
215218
You can get a list of apps that can be added to the site by using:
216219

217220
```PowerShell
218-
Get-PnPApp
221+
Get-PnPApp -Scope Tenant
219222
```
220223

221224
## Office 365 CLI commands to add, deploy, and manage SharePoint apps cross-platform

0 commit comments

Comments
 (0)