Detailed instructions/procedure for setting up a SharePoint 2016 development or test farm. This is a multi-part article. The following posts are part of this series:
- Part 1: Introduction
- Part 2: Domain Controller
- Part 3: SQL Server
- This page – Part 4: SharePoint 2016 Installation
In this article, we will perform the actual SharePoint 2016 installation. This will be a virtual machine (spVM) in the virtual network we created in Part 2 of this series. We will make spVM a member of the Windows Server AD domain, and then create a new SharePoint farm.
The values of some variables used in the Azure PowerShell commands below have been discussed in the preceding article (Part 2 of this series). Please refer to it as required.
Like before, we will start by creating an availability set…
Create a managed availability set for SharePoint virtual machines
Run the following commands at the Azure PowerShell prompt or in the PowerShell Integrated Script Environment (ISE) on your local computer. Supply your own values for subscription name and resource group name.
# Sign in to Azure (you will be prompted for credentials) Login-AzureRmAccount # Enter your own Azure subscription name $subscrName="Visual Studio Enterprise with MSDN (MPN)" # Enter your own unique resource group name $rgName="SP2016RGroup" # Set the subscription and location Get-AzureRmSubscription -SubscriptionName $subscrName | Select-AzureRmSubscription $locName=(Get-AzureRmResourceGroup -Name $rgName).Location # Create an availability set for SharePoint virtual machines New-AzureRMAvailabilitySet -Name spAvailabilitySet -ResourceGroupName $rgName -Location $locName -sku aligned -PlatformFaultDomainCount 2 -PlatformUpdateDomainCount 2
A new availability set named spAvailabilitySet will be added. You can view it in the resources list on your Azure portal.
Choose a domain name label for the SharePoint VM
At this point, you will need to decide on a globally unique name to supply to the $dnsName variable in the next block of commands. This will be a public domain name label for the SharePoint server.
The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name (FQDN) associated with the public IP address that we will create using the New-AzureRMPublicIpAddress command. We could technically omit the -DomainNameLabel flag. But by specifying it, an “A” DNS record is created for the public IP in the Microsoft Azure DNS system.
Notice that we did not need to specify a domain name label when creating the domain controller (adVM) and the SQL Server VM (sqlVM). This is because for those machines, we were not setting up websites or accessing them directly over the public internet. For the SharePoint VM (spVM), we want to be able to log in to our SharePoint websites from anywhere as long as the SharePoint farm is up and running. We make this possible in the alternate access mappings section below (using the domain name label we chose now).
The domain name label cannot be a sub-domain because the dot (“.”) character is not allowed. It can contain only lowercase letters, numbers and hyphens. The first character must be a letter. The last character must be a letter or number.
If you’re not sure if your chosen domain name label is unique, you can find one directly on the Azure portal and then come back here an plug in the value into the variable. To choose a domain name label from the Azure portal, pretend you want to create a new IP address. Like this:
- Press New on the dashboard
- In the search box that appears, type “ip” (no quotes) and select Public IP address
- Press the Create button. A new form opens that allows you to specify parameters for the new public IP address you want to create.
- Ignore all the options except for the DNS name label box. Use that box to find a unique and valid domain name label (when you enter a valid value, a green check mark will be displayed).
- Note the available label. Now you can cancel or close out of Azure portal without actually creating the public IP address.
- Supply the domain name label you chose to the $dnsName variable in the next section.
SharePoint 2016 Installation: Create the VM (spVM)
Run these commands in the same PowerShell session where you created the availability set:
$dnsName="spehikioya" $vmName="spVM" $vmSize="Standard_D3_V2" $vm=New-AzureRMVMConfig -VMName $vmName -VMSize $vmSize $pip=New-AzureRMPublicIpAddress -Name ($vmName + "-PIP") -ResourceGroupName $rgName -DomainNameLabel $dnsName -Location $locName -AllocationMethod Dynamic $vnet=Get-AzureRMVirtualNetwork -Name "SP2016Vnet" -ResourceGroupName $rgName $nic=New-AzureRMNetworkInterface -Name ($vmName + "-NIC") -ResourceGroupName $rgName -Location $locName -SubnetId $vnet.Subnets.Id -PublicIpAddressId $pip.Id -PrivateIpAddress "10.0.0.6" $avSet=Get-AzureRMAvailabilitySet -Name spAvailabilitySet -ResourceGroupName $rgName $vm=New-AzureRMVMConfig -VMName $vmName -VMSize $vmSize -AvailabilitySetId $avSet.Id $vm=Set-AzureRmVMOSDisk -VM $vm -Name ($vmName +"-OS") -DiskSizeInGB 128 -CreateOption FromImage -StorageAccountType "StandardLRS" $cred=Get-Credential -Message "Type the name and password of the local administrator account." $vm=Set-AzureRMVMOperatingSystem -VM $vm -Windows -ComputerName $vmName -Credential $cred -ProvisionVMAgent -EnableAutoUpdate $vm=Set-AzureRMVMSourceImage -VM $vm -PublisherName "MicrosoftSharePoint" -Offer "MicrosoftSharePointServer" -Skus "2016" -Version "latest" $vm=Add-AzureRMVMNetworkInterface -VM $vm -Id $nic.Id New-AzureRMVM -ResourceGroupName $rgName -Location $locName -VM $vm
If you followed the steps in the previous articles, you may get the following warning when you run the New-AzureRMVM command:
WARNING: Since the VM is created using premium storage, existing standard storage account, visuasp2016advm012215490, is used for boot diagnostics.
Your SharePoint 2016 virtual machine will be created from Microsoft’s SharePoint OS image. Now, we need to configure it.
Join the SharePoint VM to the Windows Server AD domain
Once the virtual machine has been built, use these steps to connect to it using the local administrator account credentials which you set with the Get-Credential command in the above block.
In the Azure portal, go to Resource Groups, select the name of your resource group, select spVM and press Connect. A file named spVM.rdp will be downloaded.
Run the downloaded file. If prompted, click Connect.
In Windows Security, enter the user name as spVM\<ADM_NAME>
Where, ADM_NAME is the user name you chose when you ran the Get-Credential command above.
Enter the password and click OK. If prompted, click Yes.
The sp.ehikioya.com domain was created in Part 2 of this series. Make sure that the domain controller VM is running. Now, join spVM to the Windows Server AD domain with these commands. Run them from an administrator-level Windows PowerShell command prompt on the SharePoint VM.
Add-Computer -DomainName "sp.ehikioya.com" Restart-Computer
After running the Add-Computer command, you will be required to supply domain account credentials. Use the SP\<ADM_NAME> account and password.
After spVM restarts, reconnect to it using the domain account (SP\<ADM_NAME>).
SharePoint 2016 Installation: Create a new SharePoint farm
Make sure all three VMs (adVM, sqlVM, and spVM) are up and running.
- From the Start screen on spVM, type SharePoint, and then click SharePoint 2016 Products Configuration Wizard.
- On the Welcome to SharePoint Products page, click Next.
- A SharePoint Products Configuration Wizard dialog appears, warning that some services (like IIS and the SharePoint Timer Service) may be reset. Click Yes.
- On the Connect to a server farm page, select Create a new server farm, and then click Next.
- On the Specify Configuration Database Settings page:
– In Database server, type sqlVM.
– In Username, type SP\sp_farm_db. We created the sp_farm_db user account in Part 2 of this series.
– In Password, type the sp_farm_db account password.
- Click Next.
- On the Specify Farm Security Settings page, type a passphrase twice. Record the passphrase and store it in a secure location for future reference. Click Next.
- On the Specify Server Role page, in Single-Server Farm, select Single-Server Farm, and then click Next.
- On the Configure SharePoint Central Administration Web Application page, leave the default settings and click Next.
- The Completing the SharePoint Products Configuration Wizard page appears with a summary of your settings. Click Next.
- The Configuring SharePoint Products page appears. Wait until the configuration process completes.
- On the Configuration Successful page, click Finish. The new central admin website starts.
- On the Help Make SharePoint Better page, choose if you want to participate in the Customer Experience Improvement Program, and then click OK.
- On the Welcome page, click Start the Wizard.
- On the Service Applications and Services page, in Service Account, click Use existing managed account. Leave the default settings for Service Applications and Services and then click Next.
- It may take a few minutes to display the next page.
- On the Create Site Collection page, type your site collection name (in my case EhiKioya) in Title, and then click OK.
- On the This completes the Farm Configuration Wizard page, click Finish.
- The SharePoint Central Administration web page displays.
- Open a new tab in Internet Explorer, type http://spvm/ in the Address bar, and then press Enter. You should see the default EhiKioya team site.
Your SharePoint 2016 development farm is ready. You may also want to configure an alternate access mapping to allow Internet users to access your SharePoint sites using the DNS name attached to the public IP address of the SharePoint VM.
Alternate access mapping for SharePoint 2016
- Run the following commands from the Azure PowerShell prompt on your local computer (NOT on spVM):
# Run this only if you already terminated your previous session Login-AzureRmAccount # Enter your own resource group name $rgName="SP2016RGroup" Write-Host (Get-AzureRMPublicIpaddress -Name "spVM-PIP" -ResourceGroup $rgName).DnsSettings.Fqdn
- Take note of the returned DNS name. It should look something like spehikioya.eastus.cloudapp.azure.com
- On spVM, go to SharePoint Central Admin.
- In the System Settings section, click Configure alternate access mappings.
- On the Alternate Access Mappings page, click Edit Public URLs.
- On the Edit Public Zone URLs page, click the link next to Alternate Access Mapping Collection, and then click Change Alternate Access Mapping Collection.
- In Select An Alternate Access Mapping Collection, click SharePoint – 80.
- On the Edit Public Zone URLs page, in Internet, type http://<the DNS name you got above> (in my case spehikioya.eastus.cloudapp.azure.com). Click Save.
Now, when users visit http://spehikioya.eastus.cloudapp.azure.com from the public internet, they should be able to access the default SharePoint website as long as they have correct credentials.
This concludes our installation and configuration of our SharePoint 2016 development farm.
Stop and start the virtual machines in the farm
Azure virtual machines incur an ongoing cost when they are running. To help minimize the cost of your SharePoint Server 2016 dev/test environment, use these commands to stop the virtual machines:
$rgName="SP2016RGroup" Stop-AzureRMVM -Name spVM -ResourceGroupName $rgName -Force Stop-AzureRMVM -Name sqlVM -ResourceGroupName $rgName -Force Stop-AzureRMVM -Name adVM -ResourceGroupName $rgName -Force
To start them again, use these commands:
$rgName="SP2016RGroup" Start-AzureRMVM -Name adVM -ResourceGroupName $rgName Start-AzureRMVM -Name sqlVM -ResourceGroupName $rgName Start-AzureRMVM -Name spVM -ResourceGroupName $rgName
You may want to note the order used when stopping at starting the VMs. adVM being the domain controller, should always started first and stopped last. The reverse is the case for spVM. spVM depends on sqlVM’s availability.