Monday, April 22, 2013

Remote Event Receiver Debugging (Using Developer Tools for VS 2012 RTM)

For more detail on debugging using Developer Tools Preview


  1. Create AutoHosted SharePoint App with remote event receiver.
  2. Register for Azure account.
  3. Open Azure Service bus account Select your namespace and click "Access Key". Note down the connection string.
  4. Open App for SharePoint Project Properties.
  5. Go to SharePoint Tab. Scroll down and tick "Enable Remote Event Debugging"
  6. Provide Window Azure Service connection string (from Point 3)

Remote Event Receiver Debugging (Using Developer Tools for VS 2012 Preview)

For Part 2 using Developer Tool for Visual Studio 2012 RTM

If we are developing SharePoint App for ProviderHosted / AutoHosted. We may have a requirement to create remote event receivers to handle events related to a list. 

The remove event receivers are actually handed using a service that needs to be hosted in another web project. When we do debugging web project is hosted on local machine's IIS Express. 

In this scenario it is quite difficult for both local IIS Express and remote SharePoint server to talk to each other due to network boundaries. To make debugging to work we require to do some manual changes in web.config of web project and AppManifest file of the SharePoint App Project. We also require to make use of Azure Service Bus.

For more information about Windows Azure Service Bus.

Steps to make debugging work.

  1. Create Autohosted SharePoint App with remote event receiver.
  2. Register for Microsoft Azure account.
  3. Create service Bus namespace. for e.g. if namespace is remoteevent then URL will be like https://{namespace-created}
  4. Right click web project. Select Nuget Package. Find Azure Service Bus and Install it.
  5. We need to make use of these values. Get these values according to your project.
    1. web project url on IIS Express: http://localhost:2917
    2. Bus Service namespace URL(from point 3): https://{namespace-created}
    3. Your unique web service address: https://{namespace-created}
    4. Default Issuer: (Open azure serice bus account Select your namespace and click "Access Key". write down Default Issuer)
    5. Default Key: (Open azure serice bus account Select your namespace and click "Access Key". write down Default Key)
    6. Client Secret:Value of Key "ClientSecret" inside section <appSettings> of web.config file
  6. Open web.config file of web project.
  7. Replace section <system.serviceModel> with following code
  8.   <bindings>

          <!--Used by app for SharePoint-->
          <binding name="secureBinding">
            <security mode="Transport" />

        <!-- Service Bus Binding -->
          <binding name="BasicHttpRelayBindingConfig">
            <security relayClientAuthenticationType="None" />

        <!-- Service Bus Binding -->
        <add  binding="basicHttpBinding" scheme="https" bindingConfiguration="secureBinding" />

        <!-- In this extension section we are introducing all known service 
            bus extensions. Users can remove the ones they don't need. -->
          <add name="transportClientEndpointBehavior" type="Microsoft.ServiceBus.Configuration.TransportClientEndpointBehaviorElement,  Microsoft.ServiceBus,  Version=,  Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
          <add name="serviceRegistrySettings" type="Microsoft.ServiceBus.Configuration.ServiceRegistrySettingsElement, Microsoft.ServiceBus, Version=,Culture=neutral,  PublicKeyToken=31bf3856ad364e35" />
              name="basicHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.BasicHttpRelayBindingCollectionElement, 
                        PublicKeyToken=31bf3856ad364e35" />

      <!-- Service Bus Binding -->
        <clear />
            name="{Replace with Point 6b}"
              address="{Replace with Point 6a}"
              address="{Replace with Point 6a}/mex"
              contract="IMetadataExchange" />
              address="{Replace with Point 6c}"
              behaviorConfiguration="sharedCredentials" />
          <behavior name="default">

            <!-- To avoid disclosing metadata information, 
                    set the values below to false before deployment. -->

            <!-- To receive exception details in faults for debugging 
                    purposes, set the value below to true. Set to false before 
                    deployment to avoid disclosing exception information. -->
            <serviceDebug includeExceptionDetailInFaults="true" />
          <behavior name="sharedCredentials">
                    issuerName="{Replace with Point 6d}"
                    issuerSecret="{Replace with Point 6e}" />
            <serviceRegistrySettings discoveryMode="Public" />

      <!-- Service Bus Binding -->

  9. In new <system.serviceModel> section replace
    {Replace with Point 6a}value you get from point 6 a
    {Replace with Point 6b}value you get from point 6 b
    {Replace with Point 6c}value you get from point 6 c
    {Replace with Point 6d}value you get from point 6 d
    {Replace with Point 6e}value you get from point 6 e

  10. Right click AppManifest file inside App project and click View code
  11. Replace </AutoDeployedWebApplication> with following code:
            ClientSecret="{Replace with Point 6f}" 
    AppUrl="{Replace with Point 6a};{Replace with Point 6c};" />
  12.  Open Element.xml file of you remote event receiver. Replace URL value with 6c.

That's all we need to change to make remote debugging enable.

Sunday, April 21, 2013

SharePoint (2010,2013) Setup Part 3

Part 1

Login to virtual machine on which you want to insall SQL server. Login as sp_Admin account created in Part 1

Download Auto SP Installer script from codeplex. Its quite hard to change this script in editor.

But there is another Utility available on codeplex. Download Auto SP Installer GUI from codeplex. This is very cool GUI interface to change Installer script. Using this we can easily configure installation script.

Thanx to TEAM of such cool tools.

Open GUI. Open config.xml file of Auto SP Installer (Autospinstaller/config.xml) script inside GUI

First TAB is for SharePoint installation Configuration.
Second TAB is for Configuring farm.

Third TAB is to configure it to create default Portal site or my sites site collection.

In Forth TAB we can configure different Service Applications like Search Service, UPS, Secure Store, MMS,  

Do changes as required. Then save config file.
Run Autospinstaller/AutoSPInstallerMain.ps1 file. 

Just sit back and wait for the process to complete.

Part 1

Tuesday, March 12, 2013

SharePoint (2010,2013) Setup Part 2 (SQL Install)

Login to virtual machine on which you want to insall SQL server. Login as sql_Admin account created in Part 1.

Run Setup.exe.

Go To installation > New SQL Server stand-alone

Click Ok

Tick "Include Sql Server Product Updates". Click Next.

Click Next.

Select "SQL Feature Installation" and click Next.

Select features highlighted in above screenshot and click Next.

Click Next.

Click Next.

Click Next.

Change SQL Server Agent and Database engine service accounts.
Use SQL_Service account created in Part 1

Click "Add Current User" Button. click Next.

Click Next.

Click Next.

Click Install and wait for installation to complete.

Part 1

Sunday, March 10, 2013

SharePoint Service Accounts Details

SQL Server Service Accounts

NameDescriptionLocal RightsDomain Rights
SQL_AdminUsed to Install the SQL Server.Local Administrator on the SQL Serverno special rights
SQL_ServiceService account used for the following MSSQLSERVER, SQLSERVERAGENTSQL SQLServer servicesno special rightsno special rights

SharePoint Service Accounts

NameDescriptionLocal/SQL RightsDomain Rights
SP_AdminInstall SharePoint,
Run SharePoint Configuration Wizard
Local Administrator on all the SharePoint Servers. SecurityAdmin and DB_Creator rights on the SQL Instanceno special rights
sp_farmConfigure Srerver, Run cental Admi site, Run SharePoint Timer JobLocal Admin during UPS provisioning, log on locally rightno special rights
SP_ServiceService Accounts to run Service Application Poolsno special rightsno special rights
SP_PortalAppPoolAccount is used to run web applications poolno special rightsno special rights
SP_ProfilesAppPoolApplication Pool for My site web applicationno special rightsno special rights
SP_SearchServiceAccount used to run Search Window Serviceno special rightsno special rights
SP_SearchContentAccount used to crawl contentno special rightsno special rights

SharePoint (2010,2013) Setup Part 1 (Service Accounts)

SharePoint (2010,2013) Setup Part 1 (Service Accounts)

Step 1 Create Service Accounts in Active Directory

I am assuming you have already configured active directory. If not then you can go to this site to know step by step how configure this.

Link 1

Link 2

Create Service Accounts

Service Acccount details can be found at SharePoint Service Accounts Details

I am using power shell script available at this site to create active directory user.

You can also download this script using link provided below.

  1. Download the script provided above.
  2. Run Powershell as Administrator.
  3. By default script execution is disabled. Enable it using command
    "Set-ExecutionPolicy Unrestricted"
  4. Add Service account Users in "Users.csv" as required.
  5. Run Powershell command

Saturday, November 10, 2012

Minimal Download Strategy

In SharePoint 2013 a new feature has been introduced named "Minimal Download Strategy". This feature is enabled by default in sites. One can enable or disable the feature by going to Site Features.

This is very interesting feature. This uses a single page "Start.aspx" for all your pages. It works like Start.aspx# followed by encoded URL of actual page as shown below.

When users goes from one page to another page then only encoded URL after # will be changed. And Changes between the two pages will be loaded and not the whole page. This way page will appear more quickly as only fewer bytes will be downloaded. Start page is responsible for updating changes between two pages.

As in SharePoint each page includes tons of css and images, this feature will help in reducing burden on SharePoint and will make it more responsive.

Popular Posts