SharePoint Office 365 App Environment Setup

SharePoint Office 365 App Environment Setup
5 votes, 3.40 avg. rating (71% score)

In this article we will go through the roadmap of creating office 365 App Environment setup.

What it covers

  • Prerequisites
  • Setting up development environment
  • Creating developer site collection
  • Enable App “SideLoading” in Your Existing Site Collection for Developer feature
  • Setup Visual Studio Template

Prerequisites

· Developer Machine with Windows 7 or above OS with minimum of 4 GB RAM and 40 GB free hard drive space

· Visual Studio 2013 ultimate/ Professional with Office Developer Tools

· An Office 365 tenant (or a configured SharePoint Server 2013 environment – VM or physical) or you can configure trail subscription for 30 days for a free Enterprise E3 Office 365 at https://deploy.office.com/getting-started


image

Setting up development environment


· Create an Outlook or Gmail account

· Click on “For enterprise, sign up here”

· You will pop up with below window. Enter all the details and click next


image

· Provide details in create user id screen and click Next


image

 

· Provide contact details and click ‘Text me’


image

· Then you will pop up with below window enter the verification code and click on “Create my account”.


image

· It may take a few minutes for all the services within your newly created tenant to provision. Please wait and refresh after a few minutes, in case you are missing all the tiles in the Office 365 portal.


image

 

Creating developer site collection

Click on Admin under App Tile


image

 

Scroll down on page In Admin section click on SharePoint


image

 

You can see some set of site collection already created for you by default as below image


image

· Click on New

· Click on private site collection

It will pop up with new site collection dialogue box

 


image

· In the Title section put the name you want to give for that particular site collection.

· In website address section select /sites/ then write the URL display name of the site collection.

· Under Template Selection select Developer site template.

· In administrator section write the user name of the site collection administrator.

· Storage quota is to define the space for this particular site collection in GB (You can leave it as default).

· Server resource quota is the number of resource allocate to the site collection (You can leave it as default).

· Click on ok and wait for some time

· You will see new “AdiCodeDev” site in site collection

· Click on the newly created one it will open popup


image

· Copy and paste in your browser

· Open the website web site with your admin account.

Enable App “SideLoading” in Your Existing Site Collection for Developer feature

· Install SharePoint Online Management Shell at http://www.microsoft.com/en-us/download/details.aspx?id=35588

· Search for “Window PowerShell ISE” in your machine and run as administrator mode.

Copy and paste the below code and save it as “EnableSideLoading.ps1”

$programFiles = [environment]::getfolderpath("programfiles")
add-type -Path $programFiles'\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.dll'
Write-Host 'To enable SharePoint app sideLoading, enter Site Url, username and password'
 #Get-ExecutionPolicy -List
 #Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
 #Add-PSSnapin Microsoft.SharePoint.PowerShell
$siteurl = Read-Host 'Site Url'
$username = Read-Host "User Name"
$password = Read-Host -AsSecureString 'Password' 
if ($siteurl -eq '') {
   #Enter your site collection Url, Admin User Name, and Password
    $siteurl = 'https://adicode.sharepoint.com/sites/AdiCodeDev/'
    $username = 'adi@adicode.onmicrosoft.com'
    $password = ConvertTo-SecureString -String 'Password' -AsPlainText -Force
}
$outfilepath = $siteurl -replace ':', '_' -replace '/', '_' 
try
{
    [Microsoft.SharePoint.Client.ClientContext]$cc = New-Object Microsoft.SharePoint.Client.ClientContext($siteurl)
 
    [Microsoft.SharePoint.Client.SharePointOnlineCredentials]$spocreds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password) 
    $cc.Credentials = $spocreds
    $sideLoadingEnabled = [Microsoft.SharePoint.Client.appcatalog]::IsAppSideloadingEnabled($cc);
    $cc.ExecuteQuery()
    
	if($sideLoadingEnabled.value -eq $false) {
    		Write-Host -ForegroundColor Yellow 'SideLoading feature is not enabled on the site:' $siteurl
    		$site = $cc.Site;
       		 $sideLoadingGuid = new-object System.Guid "AE3A1339-61F5-4f8f-81A7-ABD2DA956A7D"
        		$site.Features.Add($sideLoadingGuid, $false, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None);
        		$cc.ExecuteQuery();
       		Write-Host -ForegroundColor Green 'SideLoading feature enabled on site' $siteurl
	}   
	Else {
		Write-Host -ForegroundColor Green 'SideLoading feature is already enabled on site' $siteurl
	}
} 
Catch { 
    Write-Host -ForegroundColor Red 'Error encountered when trying to enable SideLoading feature' $siteurl, ':' $Error[0].ToString();
}

    

· Change the “$siteurl” , “$username” and “$password” according to your details.

· Click on Run

· It will ask you again all the details, please enter the details.

· You will get message like side loading feature enable for your site

Note: You must be a Tenant Admin to activate this feature

Visual Studio Template Setup

· Download the visual studio Ultimate/Professional 2013 from “MSDN”, if you have “MSDN” subscription. If you don’t have then download the trail version

· Install the visual studio in your machine

· Make sure its latest updated version

· Open visual studio Template with run as administrator

· Click on “File” in right top corner.

· Click on “New”

· Click on “Project”


image


image

 

· Click and expend Installed

· Click and expend Template

· Click and expend Visual C#

· Click and expend Office/SharePoint àApps

· Select the “Apps for SharePoint 2013” and enter the Name of Apps “AdiCodeApps”

· Click on ok.

Conclusion

You are now ready with Office 365 setup and dev environment. We will continue with the series of articles with quite interesting stuff that can be done with office 365 SharePoint. Stay tuned

July 28, 2015 · Adi · No Comments
Tags: , ,  · Posted in: Apps, Office 365, SharePoint 2013, SharePoint Online

Leave a Reply

What is 11 + 10 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)