Configure the App Store with PowerShell

In virtually every installation of SharePoint 2013 there is a requirement to activate the App Store.  While there are some complications with the process due to the involvement of network level configuration, the SharePoint side of the configuration is relatively straightforward.

Network Configuration

This article assumes that several pre-requisites have been completed successfully:

  1. A forward lookup zone has been created for a sub domain or top level domain, e.g. apps.SharePointLab.local or apps-SharePointLab.local
  2. A wild card CNAME record has been added to the forward look zone which points at the SharePoint domainimage

These elements can be tested by running the following commands in a PowerShell session that has elevated privileges (i.e. Run as Administrator)

ipconfig /flushdns

ping testapp.apps.SharePointLab.local

These commands refresh the values stored on the machine from DNS and then check that a response is received from the location in the forward lookup zone.

SharePoint Configuration

There are four steps to configuring the App Store in SharePoint

  1. Start the required services
  2. Create the service applications
  3. Create an app catalog site
  4. Configure the app store settings

Start the Required Services

There are two services that should be running before the configuration of the App Store can be started:

  • App Management Service
  • Microsoft SharePoint Foundation Subscription Settings Service

To start these services, run the following PowerShell:

$subscriptionService = Get-SPServiceInstance | where {$_.TypeName –eq “Microsoft SharePoint Foundation Subscription Settings Service”}

Start-SPServiceInstance $subscriptionService.Id

$appManagementService = Get-SPServiceInstance | where {$_.TypeName -eq “App Management Service”}

Start-SPServiceInstance $appManagementService.Id

Create the Service Applications

The App Management and Subscription service applications are required for the App Store.

To create the service applications a managed account is required:

$account = get-SPManagedAccount “SharePointLabSP_ServiceAppPool”;

Subscription Management

## 1.  Create an application pool

$appPoolSubSvc = New-SPServiceApplicationPool -Name “SP – Subscription Settings Service Application” -Account $account;

## 2.  Create the Service Application

$appSubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $appPoolSubSvc –Name “Subscription Settings Service Application” –DatabaseName “SP_DEV_SA_SettingsService”;

## 3.  Create the Service Application Proxy

$proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy –ServiceApplication $appSubSvc;

App Management Service

## 1.  Create an application pool

$appPoolAppSvc = New-SPServiceApplicationPool –Name “SP – App Management Service Application” -Account $account;

## 2.  Create the Service Application

$appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPoolAppSvc –Name “App Management Service Application” –DatabaseName “SP_DEV_SA_AppService”;

## 3.  Create the Service Application Proxy

$proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc;

Create an App Catalog Site

A site collection needs to be created that used the App Catalog template.

New-SPSite –Url “http://SharePointLab.local/Apps” –OwnerAlias “SharePointLabSP_AppCatalogManager” –Name “App Catalog” –Template “APPCATALOG#0”;

Once the App Catalog site collection has been created, the it needs to be set to be used as the App Catalog:

Update-SPAppCatalogConfiguration -Site “http://SharePointLab.local/Apps”

Configure the App Store Settings

The App Domain needs to be associated with the App Store:

Set-SPAppDomain “apps.SharePointLab.local”;

The prefix for the app domains needs to be set:

Set-SPAppSiteSubscriptionName –Name “app”;

Summary

Following completion of these steps, you should be able to download and use apps from the SharePoint App Store.

Leave a Reply

Your email address will not be published.