Saturday 20 May 2017

Setup SharePoint 2016 Machine on Azure

Lets see how we can setup a SharePoint 2016 environment in Microsoft Azure.
In this post I assume that you already have azure subscription, if not then please sign up first.
This is a step by step guide for creating SharePoint 2016 single server farm on Microsoft azure with Active directory domain controller, sql server and SharePoint 2016. The architecture of the farm is given below.

Resource Groups

Following resource groups will be created however you can choose to create only one resource group but here I will create four because of the different lifecycle of AD , SQL , SharePoint and networks. Here is the resource groups

1.    contosonet  : contains network security group and virtual network
2.    contosoad    : contains AD Domain controller
3.    contososql   : contains SQL server
4.    contososp    : contains SharePoint 2016.


Steps
Following steps will be followed to create the environment
  1. Step 1 : Create the resource groups.
  2.  Step 2 :  Create network security group and virtual network.
  3.  Step 3 : Create Virtual machine sp2016ad and configure Active directory domain controller. Create required service accounts
  4. Step 4. : Create virtual machine sp2016sql and configure sql server.
  5.  Step 5  : Create virtual machine sp2016sp and configure SharePoint 2016.


Step 1 : Create resource groups

Login to azure management portal at http://portal.azure.com go to resource group and click add as shown in image below.


Click create and it will be created. Similarly click add and add other resource groups like contosoad contososql and contososp.

Step 2 :  Create network security group and virtual net work


On the dashboard click new and type network security group , select the network security group and click create  type name as whatever you want , I have used “networksecuritygroup-nsg” and choose resource group as contosonet as shown in image below.

You need to allow TCP port 3389 in this network security group so that you can take the take the RDP.
So open network security group and go to inbound rules and add a rule as shown in the figure below.


Similarly, from the left pane click on virtual networks and click add as shown in image below.

Type a name I have used contosovnet and resource group contosonet click create and you are done with step 2 let go to step 3.

Step 3 : Create Virtual Machine sp2016ad and configure Active directory domain controller, Create required service accounts


Now you are little bit familiar with the screen so I will not present much screens here however I will show where something important happens.
Following steps will be followed
  1. Setup ad machine
  2. Install Active Directory Domain Service feature and create a domain
  3. Create required users.


Setup AD Machine

Go to virtual machines on the left pane and click add, a text box will be shown, type “Windows Server 2016 Datacenter”, select the same filter result and click create.
Type name : sp2016ad , username : <a user name of your choice>and password : <password> Resource group : contosoad  please note user name and password as it will be required to connect later.

When you click ok , next screen will come choose a size of your machine and click ok.
Next screen will come for settings in the settings select virtual network as contosovnet and network security group as “networksecuritygroup-nsg” which was created earlier and shown in the screen below.


Click ok and follow the screen and click ok. The vm will be provisioned.

Install Active Directory Domain Service feature and create a domain


Go to your virtual machines, click sp2016ad and click connect, a rdp file will be downloaded. Click that file and enter your credentials to connect to virtual machine.
Please note  : you can enter credentials like <machine name>\<user name> for ex . here sp2016ad\username.
Now on the virtual machine open power shell in elevated mode and type below command.

Install-WindowsFeature AD-Domain-Services -IncludeManagementTools
Install-ADDSForest -DomainName sharepoint2016.contoso.com

The second command requires a password and it will restart AD machine.
After ad machine restarted , run the rdp file and login again. Please note this time you have to login using domain account. As I have created domain sharepoint2016.contoso.com. so you can used sharepoint2016\<your user name> and password that you had given while creating vm.
 open PowerShell and run below command.
Add-WindowsFeature RSAT-ADDS-Tools

Create required users


Now create users like farm account. I will create only farm account, you can choose to create service account also.
Go to start type run and open dsa.msc or active directory users and computers.

Create new user as shown in the image above. And enter the details for farm account as below.

Click next and set password,password never expires , user can not change the password and click ok.
Go to the properties of newly created user and in “member of” add “domain admin”.

Lets move to next step and create sql machine

Step 2 : Create sqlvm and grant the required access


Following steps should be followed while creating sql machine.

  a.    Setup virtual machine
  b.    Set the dns for virtual machine
  c.    Add machine to the domain
  d.   Grant spfarm sysadmin access

Setup virtual machine


Now go to virtual machine and create a new virtual machine by clicking add. Enter “SQL Server 2016 SP1 Enterprise on Windows Server 2016” in the filter box and select the machine as shown below.

Click create and give name sp2016sql , type user name and password. Note this user name and password as it will be needed later to connect. Similarly select existing resource group as contososql and click ok.
As per pricing model select a size. It can be scaled later.
Click ok next screen is important. See how I have used same virtual network and network security group that created earlier.

Follow the screen and let it finish.

Set the dns for virtual machine


Next important work is to set the dns of sql machine (sp2016sql) to ad machine. Please note this step has to be done on SharePoint machine also.
Go to virtual machines >> sp2016ad >> network interfaces and note down the private ip of the network interface as shown in image below.

In my case, it is 10.0.0.4
Now we need to set the dns of sql machine to 10.0.0.4 lets do that.
Go to virtual machines >> sp2016sql >> network interfaces and click on the network interface.
In the network interface click on dns server and select custom and in the box type your dns server ip in my case it is 10.0.0.4 and click save as shown in the image below.

Restart the virtual machine

Add machine to the domain


Now login to your sql machine and add sql machine to the domain sharepoint2016.contoso.com .
Go to sql virtual machine>>this pc >> properties and next to workgroup click change settings.
Select domain and enter domainname as shown in image below.

Click ok. You have give domain admin password and the machine will be restarted.

Grant spfarm sysadmin access


Wait for machine to restart and login to the machine again using the credentials given while creating (machinename\username) and grant spfarm(sharepoint2016\spfarm) to sysadmin access on sql server.
And you have done with sql server now lets create machine for sharepoint.

Step 5  : Create virtual machine sp2016sp and configure SharePoint 2016.


Following steps needs to be followed.
 a.    Setup VM
 b.   Change dns for VM
 c.   Add Machine to Domain
 d.   Run SharePoint products and technology configuration wizard

Setup VM


Go to virtual machines and add a virtual machine search for sharepoint 2016 trial and click create:
Enter name “sp2016sp” and choose your username and password as you wish click ok.
Only the thing which is important is you need to choose virtual network and network security group as created before.

You can have rest things default.
Wait for machine to create.

Change dns for VM


 Now change the dns to 10.0.0.4 (in your case it is the internal ip of ad machine.) as done with sql machine.

Add Machine to Domain


And add the machine to sharepoint2016.contoso.com domain as done with sql.

Run SharePoint products and technology configuration wizard


Now we have to run the products and technology configuration wizard.
Login on sharepoint machine with spfarm account , ofcourse it will be like domainname\username for me it is sharepoint2016\spfarm and run the products and technology wizard
Create a new server farm here is settings for me.

In the next screens enter passphrase and select single server farm.after this wizard completes the SharePoint will be provisioned.



















No comments:

Post a Comment

Setup dev environment for spfx

So lets setup dev environment for SharePoint Framework abbreviated as SPFX. for an Introduction of What is SPFX and What are the capebiliti...