How to: Host an app for Office on Microsoft Azure

apps for Office

This tutorial shows how to use Visual Studio 2013 or Visual Studio 2012 and the Microsoft Office Developer Tools for Visual Studio 2012 to publish to and then host an app for Office on Microsoft Azure.

Last modified: August 01, 2014

Applies to: Access app for SharePoint | Excel 2013 | Excel 2013 RT | Excel 2013 SP1 | Excel Online | Microsoft Azure | Outlook 2013 | Outlook 2013 RT | Outlook 2013 SP1 | Outlook Web App | OWA for Devices | PowerPoint 2013 | PowerPoint 2013 RT | PowerPoint 2013 SP1 | PowerPoint Online | Project 2013 | Project 2013 SP1 | Word 2013 | Word 2013 RT | Word 2013 SP1

   Office.js: v1.0, v1.1

   Apps for Office manifests schema: v1.0, v1.1

The simplest app for Office is made up of an XML manifest file and an HTML page. The XML manifest file describes the app's characteristics, such as its name, what Office client applications it can run in, and the URL for the app’s HTML page. The HTML page is contained in an app for Office website and users see it and interact with it when they install and run your app.

Note Note

See an Overview of apps for Office for more information.

You can host the website of an app for Office on many of web hosting platforms, including Microsoft Azure. To host an app for Office on Microsoft Azure, you publish the app for Office to a Microsoft Azure website.

This tutorial assumes that you don’t have experience using Microsoft Azure. When you complete this tutorial, you'll have a simple app for Office that has its website hosted on Microsoft Azure.

You'll learn:

  • How to add a trusted app catalog to Microsoft Office 2013

  • How to create a website in Microsoft Azure using Visual Studio 2013 or the Azure management portal

  • How to publish to and host an app for Office on a Microsoft Azure website

Figure 1 shows a sample app for Office with the website hosted in Microsoft Azure.

Figure 1. A sample app for Office website hosted on Windows Azure

App for Office website hosted in Microsoft Azure

In this article

Set up your development computer with the tools you’ll need
Step 1: Create a network file share to host your app manifest file
Step 2: Add the file share to the Trusted Apps catalog so that Office client applications will trust the location where you install apps for Office
Step 3: Create a website in Microsoft Azure
Step 4: Create an app for Office in Visual Studio
Step 5: Publish your app for Office to the Azure website
Step 6: Edit the app manifest file to point to the app for Office on Microsoft Azure.
Step 7: Insert and run the app in the Office client application
Additional resources

To set up your development environment by ensure that you have the Microsoft Azure SDK for .NET, a Windows Azure subscription, and Microsoft Office 2013.

  1. Install the Microsoft Azure SDK for .NET from the Windows Azure .NET SDKs download page. If you don't have Visual Studio installed, Visual Studio Express for Web is installed with the SDK.

    1. Under Languages, choose .NET.

    2. Choose the version of the Microsoft Azure .NET SDK that matches your version of Visual Studio, if you already have Visual Studio installed.

    3. When you’re asked whether to run or save the installation executable, choose Run.

    4. In the Web Platform Installer window, choose Install.

  2. Install Office 2013 if you haven’t already.

    Note Note

    You can get a trial version for one month.

  3. Get your Microsoft Azure account.

    Note Note

    If you’re a Microsoft Developer Network (MSDN) subscriber, you get a Windows Azure subscription as part of your MSDN subscription.

    If you're not an MSDN subscriber, you can still get a free trial of Windows Azure at the Windows Azure website.

To keep the walkthrough simple and focused on using Microsoft Azure with an app for Office, you'll use a local file share as a trusted catalog where you’ll store the app's XML manifest file. For an app that you intend to be used in a business or more than one business, you might keep the app manifest file in SharePoint, or publish the app to the Office Store. For more information, see Publishing basics, in Overview of apps for Office.

  1. Open File Explorer (or Windows Explorer if you're using Windows 7 or an earlier version of Windows) on your development computer.

  2. Right-click the C:\ drive, and then choose New > Folder.

  3. Name the new folder AppManifests.

  4. Right-click the AppManifests folder, and then choose Share with > Specific people.

  5. In File Sharing, click the drop-down arrow and then choose Everyone> Add > Share.

  1. Start Word 2013 and create a document. (Although we’re using Word 2013 in this example, you could use any Office application that supports apps for Office—like Excel, Outlook, PowerPoint, or Project 2013.)

    Note Note

  2. Choose File > Options.

  3. In Word Options, choose Trust Center, and then choose Trust Center Setting, as shown in Figure 2.

    Figure 2. You access Trusted app Catalogs settings in the Trust Center dialog

    Microsoft Word Trust Center options.
  4. In the Trust Center, click Trusted App Catalogs. Enter the universal naming convention (UNC) path for the file share you created earlier as the Catalog URL. For example, \\YourMachineName\AppManifests. Then choose Add catalog. Figure 3 shows the Trusted App Catalogs dialog box.

    Figure 3. Set trusted app catalogs in Word options

    Trusted App Catalogs dialog in Word.
  5. Select the check box for Show in Menu. When you store an app XML manifest file on a share that is a trusted app catalog, the app appears under Shared Folderapps in the Apps for Office dialog box, as shown in Figure 4.

    Figure 4. Apps for Office dialog box

    Apps for Office insert app dialog.

There are a couple of ways you can create an empty Microsoft Azure website, depending upon which version of Visual Studio you're using. If you're using Visual Studio 2013, follow the steps in Using Visual Studio 2013 to create a Microsoft Azure website from within the Visual Studio IDE. If you're using Visual Studio 2012, follow the steps in Using the Azure management portal to create the Microsoft Azure website.

Using Visual Studio 2013

  1. In Visual Studio 2013, in Server Explorer, expand Windows Azure, right-click Web Sites, and then choose Add New Site as shown in Figure 5.

    Figure 5. Create a new Azure website in Visual Studio

    Add New Site command in Server Explorer.
  2. In the Create site on Windows Azure dialog box, provide this information as seen in Figure 6:

    • Enter a unique Site name for your site. Microsoft Azure verifies that the site name is unique across the azurewebsites.net domain.

    • Choose the Microsoft AzureSubscription you're using to authorize creating this website.

    • Choose a geographical Location appropriate for you.

    • For Database server:, accept the default of No database and then choose Create.

    The new website appears under Web Sites under Windows Azure in Server Explorer.

    Important note Important

    If you haven't added your Microsoft Azure subscription to Visual Studio 2013, you'll see the message No subscriptions are available in the Create site on Windows Azure dialog box.

    To proceed, choose Sign In and then enter the Microsoft account that is associated with your Microsoft Azure subscription. You can then fill out the fields in the Create site on Windows Azure dialog box.

    Figure 6. Create a site in Windows Azure dialog box

    Create a site on Microsoft Azure dialog box
  3. Right-click the new website, and then choose Open in Browser. Your browser opens and displays a webpage with the message "This web site has been successfully created."

  4. In the browser address bar, change the URL for the website so that it uses HTTPS and press Enter to confirm that the HTTPS protocol is enabled. The app for Office model requires apps to use the HTTPS protocol. Azure automatically creates websites with HTTPS.

  5. In Visual Studio 2013, right-click the new website in Server Explorer, choose Download Publish Profile and then save the profile to your computer, as shown in Figure 7. The publish profile contains your credentials and enables you to Step 5: Publish your app for Office to the Azure website.

    Figure 7. Download Publish Profile command in Visual Studio 2013

    Download Publish Profile menu item.

Using the Azure management portal

  1. Log in to the Azure management portal using your Microsoft Azure account.

  2. Choose NEW> COMPUTE> WEB SITE> QUICK CREATE.

    Figures 8 and 9 show the section of the Azure management portal where you can create a website.

    Figure 8. Compute>Web site tab in the Azure management portal

    Create an Azure web site in the managment portal.

    Figure 9. Website Quick Create dialog box in the Azure management portal.

    Enter a URL for a new Azure web site.
  3. Under URL, enter a unique site name to complete the URL for the website. The management portal verifies that the site name is unique across the azurewebsites.net domain.

  4. Choose a geographical REGION appropriate for your site.

  5. Choose CREATE WEB SITE. The Azure management portal creates the website and redirects to the web sites page where you can see the website’s status.

    When the website status is Running, choose the URL for the website under the URL column. Your browser opens and display a webpage with the message This web site has been successfully created as shown in Figure 10.

    Figure 10. The default page for the Azure website.

    Successful website creation webpage message.

    In the browser address bar, change the URL for the website so that it uses HTTPS and press Enter to confirm that the HTTPS protocol is enabled. The app for Office model requires apps to use the HTTPS protocol. Azure automatically creates websites with HTTPS.

  6. On the web sites page, choose the new website.

  7. Under Publish your app, choose Download the publish profile and save the publish profile to your computer, as shown in Figure 11.

    Figure 11. Download the publish profile link on the Windows Azure management portal

    Download the Azure publish profile.

    The publish profile contains your credentials and enables you to securely publish to Microsoft Azure.

  1. Start Visual Studio 2012 as an administrator.

  2. Choose File> New > Project.

  3. Under Templates, expand Visual C# (or Visual Basic), expand Office/SharePoint, and then choose Apps.

  4. Choose App for Office 2013, and then choose OK to accept the default settings.

  5. When Create app for Office appears, leave the default choice for a Task pane app and choose Finish.

Your basic app for Office is created and ready to publish to Microsoft Azure.

Note Note

Since the point of this topic is to show how to publish to Azure, you won't make any changes to the sample app that you created by using the standard Visual Studioapp for Office template.

  1. With your sample app open in Visual Studio, expand the solution node in Solution Explorer so that you see both projects for the solution.

  2. Right-click the web project, and then choose Publish as shown in Figure 12.

    Figure 12. Publish your app to Azure using Visual Studio

    Publish project command in Visual Studio 2012.

    The web project contains app for Office website files so this is the project that you publish to Microsoft Azure.

  3. In Publish Web, choose Import.

  4. In Import Publish Profile, choose Import from a publish profile, choose Browse, and then browse to the place where you saved your publish profile earlier in this topic. Choose OK to import your profile.

  5. In Publish Web, on the Connection tab, accept the defaults and choose Next >.

    Note Note

    Choose Next > again to accept the default settings.

  6. On the Preview tab, choose Start Preview. The preview shows you all the files in the web project that will be published to the Azure website.

  7. Choose Publish. Visual Studio publishes the web project for your app for Office to your Azure Web Site.

  8. When Visual Studio finishes publishing the web project, your browser opens and shows a webpage with the text "This web site has been successfully created." This is the current default page for the website.

    To see the webpage for your app, change the URL to use https: and add the path of your app's default HTML page. For example, the changed URL should look like https://YourDomain.azurewebsites.net/App/Home/Home.html. This confirms that your app's website is now hosted on Microsoft Azure. Copy this URL because you'll need it when you edit the app manifest file later in this topic.

  1. In Visual Studio with the sample app for Office open in Solution Explorer, expand the solution so that both projects show.

  2. Expand the app for Office project, for example OfficeApp1, right-click the manifest folder, and then choose Open. The app manifest properties page shows.

  3. For Source Location:, enter the URL for the app's main HTML page Step 5: Publish your app for Office to the Azure website, for example, https://YourDomain.azurewebsites.net/App/Home/Home.html.

  4. Choose File, and then choose Save All. Close the app manifest properties page.

  5. Back in Solution Explorer, right-click the manifest folder and choose Open Folder In File Explorer.

  6. Copy the app manifest file, for example OfficeApp1.xml.

  7. Browse to the network file share that you created earlier in the topic and paste the manifest file into the folder.

  1. Start Word 2013 and open a new document.

  2. On the Ribbon, choose Insert> Apps for Office, and then choose See a.

  3. In the Apps for Office dialog box, choose SHARED FOLDER. Office client applications that work with the apps for Office model scan the folder that you list as a trusted app catalog and show the apps in the dialog. You should see the icon for your sample app.

  4. Choose the icon for your app and then choose Insert. The app is inserted on the side of the client application.

  5. Test that the app is working by creating some text in the document, then selecting the text, and then choosing Get data from selection.

Show:
© 2014 Microsoft