The Help Desk demo, Part 1–Creating the project

The first step creating a new website, naturally, is to create a new Visual Studio project.  In this case, it’ll be a new ASP.NET MVC project built in Visual Studio 2015.  I won’t go through the individual steps for creating a new web project, since that information is available in many, many places around the Internet.  The project name for this website will be ‘BusinessApps.HelpDesk’, since the resulting application from this walk through is ultimately designed to be incorporated into the Office 365 Developer Patterns and Practices repository, and that naming scheme matches the existing naming scheme in the repository.

Once the project has been created, we’ll need to add a couple of NuGet packages.  The NuGet Package Manager is available by right clicking on the project name and selecting ‘Manage NuGet packages…’:


Once the NuGet Package Manager opens, the ‘AppForSharePointOnlineWebToolkit’, ‘jQuery.UI.Combined’, ‘Microsoft.Owin’, ‘Microsoft.Owin.Security.OpenIdConnect’, and ‘Microsoft.IdentityModel.Clients.ActiveDirectory’ packages can be added.  All of these packages will install additional dependencies.

The SharePoint functionality will also require that Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime be added as references.


Next, some appSettings need to be added to the web.config.  Add the following settings:

    <add key="AzureId" value="" />
    <add key="CertThumbprint" value=""/>
    <add key="Tenant" value="" />
    <add key="OperationsWebsite" value="" />
    <add key="SharePointSite" value=""/>

Right now, only the tenant and SharePoint sites are known.  The tenant can either be the name or a custom domain, if one has been added.  In my case, I’m going to use ‘’.  My SharePoint site is ‘’ and the Operations team site is ‘’.

To make those and other settings easy to use, a SettingsHelper class is used.  Since there will certainly be other Helper files as the project progresses, it’s probably a good idea to first create a Settings folder and then add the Settings class to that folder.  The Settings class looks like this.

using System.Configuration;

namespace BusinessApps.HelpDesk.Helpers
    public class SettingsHelper
        public static string ClientId => ConfigurationManager.AppSettings["AzureId"];
        public static string CertThumbprint => ConfigurationManager.AppSettings["CertThumbprint"];

        public static string AzureADAuthority => @"" + ConfigurationManager.AppSettings["Tenant"];
        public static string AzureADAuthAuthority => @"" + ConfigurationManager.AppSettings["Tenant"] + "/oauth2/token";
        public static string LogoutAuthority => @"";
        public static string GraphUrl => @"" + ConfigurationManager.AppSettings["Tenant"] + "/";

        public static string GraphResource => @"";
        public static string SharePointResource => ConfigurationManager.AppSettings["SharePointSite"];

        public static string HelpDeskEmailAddress => ConfigurationManager.AppSettings["HelpDeskEmailAddress"];

The Help Desk Demo

The entire source code for the Help Desk demo can be found here, in the Office 365 Dev PnP GitHub repository.

Leave a Reply

Your email address will not be published.