Export (0) Print
Expand All

How to: Publish an app for SharePoint by using Visual Studio

apps for SharePoint

Learn how to publish your app for SharePoint by using Microsoft Visual Studio 2013 or Visual Studio 2012. If the app has an associated web application, you deploy it first. Then, as for all apps for SharePoint, you package the app for SharePoint and then publish it. You can also optionally choose to submit your app for inclusion on the Office Store.

Last modified: April 29, 2014

Applies to: apps for SharePoint | Office 365 | SharePoint Foundation 2013 | SharePoint Server 2013

In this article
Prerequisites
Publish by using Visual Studio 2013
Publish by using Visual Studio 2012
Additional resources

  • Microsoft Visual Studio 2013

    -or-

    Visual Studio 2012 and the Office Developer Tools for Visual Studio. To download those tools, see "Tools" on the Download page. (The new Publish Manager is not available in Visual Studio 2012 or earlier versions.)

  • Microsoft SharePoint 2013

If your provider-hosted app for SharePoint has a web application, deploy the files for it first. You then, as for all apps for SharePoint, package the app for SharePoint and publish it.

Important note Important

To ensure that your SharePoint Client ID and Client Secret values get published with your web project, which allows your web content to access SharePoint data, publish your app for SharePoint project from the Publish your app page. You access this page by opening the shortcut menu for the app for SharePoint, not the shortcut menu for the web app, and then choosing the Publish command.

Step 1: Deploy the web application

Your app for SharePoint typically has an associated host web application that you need to deploy to a web server. For more information about how to use the Publish Web wizard, see How to: Deploy a Web Project using On-Click Publishing in Visual Studio.

To open the Publish your app page

  • In Solution Explorer, open the shortcut menu for the app for SharePoint project, and then choose Publish.

    The Publish your app page appears.

To select or create a profile

  • In the Current profile list, choose a profile to import, or choose <New …> to create a profile.

    A publish profile specifies the server to which you're deploying the web app, the credentials that are needed to log on to the server, the databases to deploy (if applicable), and other deployment options. You can create different publish profiles to fit your needs. For example, you might create one profile for testing and another profile for publishing.

    If you choose <New …>, the Create publishing profile wizard appears. You can use this wizard to import a publishing profile from a website hosting provider, such as Azure, or to create a profile and then manually add your server name, credentials, and other settings. If you created a new profile rather than imported an existing profile, you'll need to supply client Id and client secret values, as outlined in Guidelines for registering apps for SharePoint 2013 and How to: Create Client IDs and secrets in the Microsoft Seller Dashboard.

    If you plan to submit your app for SharePoint to the Office Store, be sure to use client ID and client secret values that are created in the Seller Dashboard. You can use client IDs and client secret values that you generate by using the appregnew.aspx page during the development phase, but apps that you submit to the Office Store must use client IDs and client secrets that you get from the Seller Dashboard. Also, you should create the publishing profile on your Azure site and then import it into Visual Studio, rather than creating a profile in the Create publishing profile wizard. When you create a profile in Azure, all of the settings on the Connection tab are provided for you in Visual Studio. For more information about how to import or create a publishing profile, see Creating a Publish Profile.

    Tip Tip

    If you can't publish web content directly, you can create a web deploy package that an administrator can deploy to the web for you. To create a web deploy package, create a new profile, choose the Connection tab, and then choose Web Deploy Package in the Publish method list.

To deploy your web app project

  1. On the Publish your app page, choose the Deploy your web project button.

    The Publish Web dialog box appears.

  2. On the Connection and Settings tabs, fill in any missing values.

    To change how the files for your app for SharePoint are published or if the app uses an external database, choose the Settings tab. See the section "Configuring the Settings Tab" in How to: Deploy a Web Project using On-Click Publishing in Visual Studio.

  3. To review what items will change when the web app is deployed, choose the Start Preview button on the Preview tab.

  4. Choose the Publish button to deploy the web app project.

Step 2: Package the App

  1. On the Publish your app page, choose the Package the app button.

    The Publish apps for Office and SharePoint wizard appears.

  2. In the Where is your website hosted? text box, enter the URL of the website that will host the content files of your app for SharePoint.

    You must specify an address that starts with the "https" prefix. See Why do my apps have to be SSL-secured?.

    Note Note

    Azure web sites automatically provide an https endpoint. If you publish your app on an Office Store site or to the Office Store, the address must start with an https prefix. However, if you publish the app to an on-premises site, you can use an http prefix.

    In the What is the app's client ID? text box, the client ID that you entered in the publishing profile should already appear.

    If you’ve used a placeholder value for the client ID until this point, you must add an actual client ID now. This information is embedded in the .app package and enables your web content to communicate with SharePoint on the live site.

  3. Choose the Finish button.

    Visual Studio generates the files that are needed to publish your app for SharePoint and then opens the publish output folder. For information about how to install the app, see Install and manage apps for SharePoint 2013.

Step 3: Publish your app for SharePoint on the Office Store

Perform the following procedure if you want to submit your app for SharePoint to the Office Store.

  1. On the Publish your app page, choose the Visit the Seller Dashboard button, and then sign in to your Microsoft Seller Dashboard account.

    See Microsoft Seller Dashboard 101 and Create Your Account and Add Payout Information in the Microsoft Seller Dashboard.

  2. Choose the Add New App button, fill out the information, and then submit the app to the Office Store.

    See Add Apps in the Microsoft Seller Dashboard.

When you're ready to package your app for SharePoint, open the Publish Office Apps wizard, which prepares the files in your app for SharePoint for publishing.

Step 1: Package the app for SharePoint

  1. In Solution Explorer, open the shortcut menu for the app for SharePoint project, and then choose Publish.

    The Publish Office Apps wizard appears. The type of app for SharePoint that you’re packaging determines the pages that appear in the wizard. If your app will be SharePoint-hosted, only the Summary page appears. If your app will be provider-hosted, the Profile and Hosting pages also appear.

  2. If your app for SharePoint is provider-hosted, specify a publishing profile name in the Which profile do you wish to publish? list, and then choose the Next button.

    The publishing profile saves the information that you enter in the Hosting page.

  3. In the Where is your website hosted? list, specify the URL for the web application that will host your app for SharePoint.

  4. In the boxes under What is the identity of your app?, specify the client ID and client secret for your app, and then choose the Next button.

    See Authorization and authentication for apps in SharePoint 2013.

  5. For all types of apps for SharePoint, select the Open output folder after successful packaging check box, if it isn’t already selected, and then choose the Finish button.

    Visual Studio generates all of the files that you need to publish your app for SharePoint. You can find these files in the app.Publish folder of your project output folder (for example, %UserProfile%\Documents\Visual Studio 2012\Projects\MyApp\bin\Debug\app.publish). That folder will contain a .app file for your app for SharePoint and multiple files for the web application (if your app for SharePoint is cloud-based). All apps for SharePoint include a .app file, which is the app manifest to publish the app for SharePoint. Provider-hosted apps for SharePoint also include files for publishing the host web application.

Step 2: Publish the web application

If your app for SharePoint is provider-hosted, you'll typically have an associated host web application that you need to publish to a web server. Visual Studio generates a deployment package and a script to help you perform this task.

The deployment package of the web application project is contained in a compressed (.zip) file in the app.publish folder. In addition to the .zip file, the app.publish folder contains the following files:

File

Description

ProjectName.deploy.cmd

This file is a command-line batch file that invokes Web Deploy so that you can more easily install the package at a command prompt.

ProjectName.SetParameters.xml

This file contains parameters that are passed to Web Deploy when you use the deploy.cmd file to install the package. The Visual Studio package settings determine the default value that's specified for each parameter. You can change these values if, for example, you want to install the web application to multiple servers and use different settings for each server.

ProjectName.SourceManifest.xml

This file contains settings that Visual Studio passes to Web Deploy and that Web Deploy uses to create the web package. Web Deploy requires this file only to create the package. This file isn't used when the package is installed.

For step-by-step guidance, see How to: Install a Deployment Package Using the deploy.cmd File Created by Using Visual Studio

Step 3: Publish your app for SharePoint

To publish your app for SharePoint, upload the app manifest file (.app) of your app to the Office Store, the Apps for Office catalog, SharePoint, a file share, or the Exchange catalog. The app manifest for your app is located in the app.publish folder, such as %UserProfile%\Documents\Visual Studio 2012\Projects\MyApp\bin\Debug\app.publish. For more information about how to publish your app for SharePoint, see Authorization and authentication for apps in SharePoint 2013.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft