Now that you understand the
four main parts of an app you can begin the process of packaging and
publishing your own app. When you package an app you essentially take
the Web deploy package, database package, SharePoint solution package
and app.manifest and combine them into an .app file. After you have an .app
file you are ready to publish it to a location where users can install
it. You can publish an app either using a private app catalog or the
public SharePoint store.
Packaging an App
After you have completed developing an
app and are ready to deploy it to either an on-premises SharePoint farm
or to SharePoint Online, you need to get it ready for deployment by
packaging it.
As Chapter 3, “Developer Tooling for SharePoint
2013” discusses, Visual Studio 2012 provides some excellent tools to
increase your productivity when writing SharePoint apps, but the help
doesn’t stop there. Visual Studio provides a number of tools to help
you package your apps into .app
files for either automated or manual deployment. In fact, when you
press F5 to debug an application, Visual Studio packages the app and
deploys it automatically to SharePoint for you!
Visual Studio provides integrated publishing
wizards that guide you through the process of packaging your
application. This wizard varies depending on the type of application
you have built, but in each type the process starts by using the
Publish function available when you right-click your application
project. See Figure 1.
Depending on the type of app you have built, the
deployment wizard varies and requires different information. For
example, in some cases it asks for a client ID and client secret
whereas in SharePoint-hosted apps no additional information is needed
at all. The following section, “Deploying an App,” explores the
deployment process in more detail for each type of application package
and walks through examples of each.
Private Publishing in an App Catalog
Before an application can be installed
you must publish it to either a private app catalog, on premises or in
SharePoint Online, or in the public Marketplace provided by Microsoft.
Many organizations may want to build applications that only they intend
to use, or they may turn off the ability to purchase apps from the
Marketplace and only offer apps they provide in the private app
catalog. The app catalog enables organizations to offer a private and
curated app catalog that they control to users in the organization.
An app catalog is simply a SharePoint site based
on a provided template. An organization can create and configure an app
catalog in a few simple steps and offer users a curated list of apps
with which the organization is comfortable with. After you create the
apps, installing them from the catalog into a site is seamless and
integrated into the existing app installation process.
In following exercise you will learn how to create a new app catalog for privately deploying apps to.
TRY IT OUT: Creating a Private App Catalog in Office 365
In this example you create an app
catalog for SharePoint Online. You need a SharePoint Online site prior
to starting this exercise.
1. Navigate to portal.microsoftonline.com and log in with your Office 365 credentials. You must be a tenant administrator in order to do this exercise.
2. Under the Admin menu in the top navigation, click SharePoint to go to the SharePoint Online tenant admin pages as shown in Figure 2.
3. Click apps in the left-side navigation in the screen that appears.
4. Click the App Catalog link.
5. Select the Create a new app catalog site option and then click OK.
6. On the Create page, enter Contoso App Catalog in the Title field.
7. Ensure /sites/ is selected in the drop-down list and then type in AppCatalog in the box to the right. This is the site collection URL for the site.
8. Enter your
name in the Administrator field and make sure it resolves to the
correct account using the provided tick button to the right. The form
should look like the one shown in Figure 3.
9. Click OK to create the catalog; the site will start to be created.
10. After the
process completes, go back into the app configuration settings in your
tenant admin by clicking the apps link in the left-side navigation.
11. Click the
App Catalog link. The catalog site that you just created appears. You
have now created a private app catalog for your organization and can
start to populate it with apps.
How It Works
An app catalog is simply a
SharePoint collection based on a particular template. In this exercise
you created the catalog site collection via the SharePoint Online
tenant admin site. This instructed SharePoint to create the site and
configure it to be the catalog for your tenancy. It is now ready for
apps to be deployed to it.