In this wiki article, I will give an overview on how to set up your development environment for Office 365.
Office 365 Developer Tenant
Before you can start coding, you need an Office 365 developer tenant. You could sign up for a 1-year free developer subscription at: http://dev.office.com. Navigate to the website, follow the instructions and sign up. You will receive a welcome email with a link to sign up for an Office 365 development tenant. First Release will be enabled already for this tenant.
You could also create an Office 365 developer tenant using your MSDN subscription (Premium and Ultimate).
The Office 365 development tenant is for developing and testing purposes only.
For a development environment, you can choose between Visual Studio Code or Visual Studio 2015. Visual Studio Code is the free open source tool Microsoft developed. Check the download section for downloading VSCode.
For most development tasks VSCode will be suitable. However, if you want to use the Office Development tools for Visual Studio, you need to install Visual Studio 2015 with update 2. The Office Development tools will provide some project templates that give you a head start on developing SharePoint Add-ins or Office Add-ins. Besides Office 365 development, Visual Studio will provide project templates targeting the old on premise development model as well (SharePoint and VSTO solutions). So, you should focus on the templates displayed in the image below:
In VSCode you have to write almost everything from scratch. There are some helpful open source tools, but it will not give you the same development experience that Visual Studio 2015 will give.
Office 365 Developer Patterns & Practices Tools
Besides the Microsoft tools there is a community project called Office 365 Developer Patterns & Practices (PnP). The focus of PnP is to provide training, guiding, articles and solutions to support the community.
One of the key elements PnP is offering is a framework which makes it easy to develop Office 365 solutions. This is an open source library on GitHub called SharePoint PnP Core. You can include this library in all your Visual Studio projects using a NuGet package. After installing this NuGet package you can call common CSOM/REST operations using Extension Methods.
The PnP Core team also provides the PnP Remote Provisioning Engine. With this engine you can provision SharePoint on premise and SharePoint Online artifact using SharePoint CSOM instead of the ‘old’ SharePoint feature framework.
Another solution which is provided by the PnP Core Team is the PnP Powershell Cmdlets. This solution contains a library of PowerShell commands that allows you to perform provisioning and management actions towards SharePoint on premise and SharePoint Online.
You can download a .msi setup package from GitHub to install the PnP Powershell Cmdlets. If your operating system is Windows 10 or Windows Server 2016 (or have PowerShell 3.0 installed), you can install the Cmdlets from within your PowerShell Command line.
Install-Module SharePointPnPPowerShellOnline -AllowClobber
Install-Module SharePointPnPPowerShell2016 -AllowClobber
Install-Module SharePointPnPPowerShell2013 –AllowClobber
To install the latest version of the Node.js runtime, navigate to the Node.js website. After installing, update the NPM package manager to the latest version using the node.js command line. Type the following command:
npm install -g npm
This concludes setting up your development environment for Office 365. Below is a list for further reading. You should definitely check these out. There is a lot more information on PnP and the SharePoint Framework there.
- SharePoint / Office 365 Dev Patterns & Practices (PnP)
- SharePoint PnP Core
- PnP Provisioning Framework
- PnP Provisioning Engine
- Introduction to Office 365 Dev PnP Provisioning Engine
- What you should learn to prepare for developing solutions on the SharePoint Framework