IT tutorials
 
Applications Server
 

Packaging and Deploying Sharepoint 2013 Apps : Deploying an App (part 2) - Provider-Hosted App Deployment

2/8/2014 1:16:55 AM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

2. Provider-Hosted App Deployment

Provider-hosted applications are the most complex of the three app types because hosting and running the application code is up to the developer, rather than allowing SharePoint and Azure do these things for you. However, with the increased complexity comes increased flexibility, because you manage your application’s back end. This means that making fixes or updates to it is straightforward, and the ultimate user for the application might never know or care to know about the changes being made to the application. Only if you make changes to the components of your app that reside within the SharePoint site itself would you need to issue an update to the application package in the app catalog or Marketplace. However, you should consider that you might need to deal with multi-tenancy issues, such as tenant specific–data partitioning, given that an app may be installed on multiple sites.

Deploying a Provider-hosted application happens in two main stages:

1. Deploying the application back end
2. Deploying the SharePoint application package

The application backend can theoretically be any technology and is not limited to Internet Information Server. The only stipulation is that the SharePoint farm or SharePoint Online must be able to communicate with it over HTTP (port 80) and HTTPS (port 443).

For on-premises applications, Provider-hosted applications are the only choice when back-end code is involved. This requires setting up server-to-server authentication .

Now try out deploying a Provider-hosted application in the following exercise using SharePoint Online and Windows Azure.


Deploying a Provider-Hosted App

In this example you create a very basic SharePoint Provider-hosted application using Visual Studio and Azure Web Sites. You need a SharePoint Online tenant set up as well as an Azure account with Azure Web Sites enabled. You also need to have the app catalog created from the previous exercise, “Creating a Private App Catalog in Office 365,” prior to starting this exercise.

1. Log into the Azure management portal and create a new Azure Web Site as shown in Figure 7. You must give it a unique URL, so remember to write it down because you will need it later on.

FIGURE 7

image

2. After the site is created, go into the Azure dashboard for the site and download the publishing profile for Visual Studio using the Download publish profile link. Save the file locally somewhere.

3. Navigate to SharePoint Online’s tenant admin screens by logging into: http://portal.microsoftonline.com, clicking the Admin menu in the top right of the homepage and then selecting SharePoint. Create a new SharePoint Developer site by clicking into the Site Collections management page, and then click the New button and select Private Site Collection, as shown in Figure 8.

FIGURE 8

image
4. Give your site a title; for example, My New Site, as well as a URL, such as mydevsite. Select the Developer Site template from the list of available templates, as shown in Figure 9, and then click OK.

FIGURE 9

image

5. After the site has been created, navigate to it and then navigate to the following page in the browser: https://<my SPO site url>.sharepoint.com/sites/mydevsite/_layouts/15/appregnew.aspx.

6. After the form appears, complete it by clicking the Generate button to create the client ID and secret for you.

7. Give your application a name such as My Awesome App.

8. In the App Domain box specify the exact URL for the Azure Web Site you created in step 1. The form should look like Figure 10.

FIGURE 10

image

9. Click Create to create the application registration.

10. Copy all the details provided about the application registration. Figure 11 shows an example.

FIGURE 11

image

11. Create a new SharePoint app in Visual Studio using the App for SharePoint 2013 template.

12. Enter the name of your app in the first box; for example, My Awesome App.

13. Enter the URL to your SharePoint Online development site.

14. Select Provider-hosted from the app type drop-down list. When it’s complete, the form should look similar to Figure 12.

FIGURE 12

image

15. Click Finish.

16. Right-click the Web project in the solution and select Publish as shown in Figure 13.

FIGURE 13

image

17. Click the Import button and select the profile file you downloaded from Azure previously. Download it from Azure if you skipped this step earlier. Validate the connection to make sure it’s working by clicking the Validate Connection button as shown in Figure 14.

FIGURE 14

image

18. Click Publish and let your site deploy. When the deployment finishes, a browser should pop up a screen like the one shown in Figure 15.

FIGURE 15

image

19. Go back into the Azure management dashboard for your site and click the Configure tab. Create the ClientId and ClientSecret app settings and copy in the App ID and App Secret you generated in step 10 (see Figure 16). Azure Web Sites reads them from here even if you have them in your web.config. Not configuring the settings in Azure will mean your app crashes.

FIGURE 16

image

20. Click the Save button to commit the settings to Azure.

21. Right-click the SharePoint app project in Visual Studio and choose Publish. If the Publish wizard is not already on the profile page, click profile in the left-side navigation to get to the Start screen.

22. Type a new profile name; for example, Office 365 Profile, and click Next.

23. On the Hosting page enter the full URL to your Azure Web Site, including the /pages/default.aspx; for example, https://cjsproviderhostedapp.azurewebsites.net/pages/default.aspx. See Figure 17.

FIGURE 17

image

24. Enter the App ID you generated into the Client ID field and the App Secret into the Client Secret field.

25. Click Next. A summary page appears like the one shown in Figure 18.

FIGURE 18

image

26. Click Finish. A new Windows Explorer window opens with your application package called MySharePointProviderHostedApp.app.

27. Open a browser window and navigate to the tenant admin portal for your Office 365 environment at: http://portal.microsoftonline.com.

28. Under the Admin menu in the top navigation, click SharePoint to go to the SharePoint Online tenant admin pages.

29. Click Apps in the left-side navigation.

30. Click the App Catalog link. The app catalog you created in the previous exercise appears.

31. Click the Distribute apps for SharePoint tile.

32. Click the New App button. You are prompted to pick the .app file for your application.

33. Click Browse and select the .app file that Visual Studio packaged for you in step 26. Click OK. A dialog appears asking for information about your application, as shown in Figure 19.

FIGURE 19

image

34. You are not required to enter any information, but you can enter the information if you want to, and then click Save. Your SharePointProviderHostedApp application appears in the app catalog.

35. Navigate to your development site in SharePoint Online.

36. Click Site Contents in the left-side navigation.

37. Click Add an App.

38. Click From Your Organization in the left-side navigation; you should see your newly added application listed.

39. Click the tile for the application. A prompt appears asking whether to trust your app.

40. Click Trust It, as shown in Figure 20. Your new app appears listed in the site contents.

FIGURE 20

image
41. Click it. You are redirected to your app and should see the title (whatever you called your site when you created it) of your site written to the page, as shown in Figure 21.

FIGURE 21

image

How It Works

In this exercise you created a rudimentary SharePoint Provider-hosted app that simply lists the name of the host site that app is installed in. You created, packaged, and deployed the code portion of your application to an Azure Web Sites site and configured the client ID and secret in the settings for that application. You then packaged and deployed the SharePoint app using Visual Studio’s Publish wizard. Once the packaging process was complete you uploaded the newly created app package to the app catalog in SharePoint Online.
Behind the scenes Visual Studio uses Web Deploy to deploy the app code to the Azure Web Site. When the application ran, it used the Client-Side Object Model (CSOM) combined with OAuth to call back to SharePoint and retrieve the name of the host Web SharePoint site. It did this using the client ID and secret you set up in the Azure settings along with the TokenHelper class provided in the app template project in Visual Studio.
 
Others
 
- Packaging and Deploying Sharepoint 2013 Apps : Deploying an App (part 1) - SharePoint-Hosted App Deployment
- Microsoft Lync Server 2013 Edge Server : Edge Server Administration (part 5) - Managing External Web Conferencing Features
- Microsoft Lync Server 2013 Edge Server : Edge Server Administration (part 4) - Managing Public Providers
- Microsoft Lync Server 2013 Edge Server : Edge Server Administration (part 3) - Managing XMPP Federation
- Microsoft Lync Server 2013 Edge Server : Edge Server Administration (part 2) - Assigning External Access Policies, Managing Federation
- Microsoft Lync Server 2013 Edge Server : Edge Server Administration (part 1) - Editing the Global External Access Policy, Creating a New External Access Policy
- Microsoft Lync Server 2013 Edge Server : Edge Server Configuration
- Packaging and Deploying Sharepoint 2013 Apps : Packaging and Publishing an App
- Packaging and Deploying Sharepoint 2013 Apps : Anatomy of an App (part 3) - Web Deploy Package, Database Package
- Packaging and Deploying Sharepoint 2013 Apps : Anatomy of an App (part 2) - Manifest and Assets, SharePoint Solution Package
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us