Wednesday, July 8, 2015

Setting up a SharePoint 2013 Development Environment In Azure using AutoSPInstaller Part 1

About a year ago, I created an extremely long winded post about how to set up a SharePoint VM in Azure.   I am back this year to simplify those instructions even further, while making the environment a bit more robust.  Now, it's definitely worth mentioning, that I believe the SharePoint world needs to get to O365 ASAP, but many organizations are not ready to take that plunge.    Also, with the basics laid out here,  maybe you can start working toward setting up a hybrid SP environment. Perhaps I'll even do a post on that (no promises right now).

The new instructions/environment has the following features:

  1. Separate AD server in its own cloud service - this should help if you ever wanted to scale,  I doubt I ever will but it's nice to play with something a little closer to what might be implemented in a true prod scenario.
  2. Separate Standalone SP Server 
  3. Some additional Guidance on Azure Best Practices
  4. SP setup using the latest AutoSPInstaller tools (including the new online configuration tool).
  5. Additional References for even more detail.   I'm no infrastructure expert, so I've relied on the great articles/posts/etc and want to make sure you have these in case you want to dig a little deeper.
So let's just dive in.  I used the classic portal (not the preview portal) to set all this up.

Part 1:  Just a few prerequisites

  1. Start by creating a new virtual network.
    1. Give your network a name (any name)
    2. Pick a nearby region (it's probably smart for you to consistently pick this region from here on out, unless you have a specific need not to)
    3. Skip the DNS and VPN steps
    4. Give your subnet a name and change the CIDR to /24, this will limit you to 256 addresses, but I don't think I'll need more than that.
    5. Verify that your Virtual Network was created.



Part 2: Setting up your AD Server.



  1. Create a cloud service for your AD Server(s)  - you may want to create more AD servers in the future for fault tolerance, performance, etc, but I'm only creating one for now, but setting up the Cloud service with a good name for this ensures that you can scale down the road.
    1. Go to the Cloud Services tab and then choose the "+ New" button
    2. Choose Compute > Cloud Service > Custom Create
    3. Give your new cloud service a name and choose the affinity group you set up earlier.   By setting the cloud service up now, (in my opinion) it removes the confusion of allowing Azure to do it for you during VM configuration.    I named my service mySubscriptionNameADSVC.
  2. Now let's set up the AD VM
    1. Go to the Virtual Machines tab and click the "+NEW" button
    2. Choose Windows Server 2012 R2 Datacenter and click the next arrow
    3. On Page 2
      1. Give the VM a name
      2. I chose the Basic Tier (my MSDN monthly $ only goes so far)
      3. I chose the A0 size (also because I'm trying not to burn through all my dough, and the SP server is a money hog)
      4. Enter a good user name and Password then click the next button
    4. ON Page 3
      1. Choose the Cloud Service you created above (if you let it create a new service it'll create one named after your VM, rather than a sensible name for multiple VMs to use which may be annoying if you actually wanted to add another machine later on)
      2. Choose the Virtual Network you created before
      3. There should only be one subnet if you're following along
      4. Use an automatically generated storage account 
      5. Ignore the availability set
      6. Click the next arrow
    5. On Page 4
      1. Choose to "Install the VM Agent"
      2. Then click next and the VM will start provisioning.
  3. Once the Provisioning is complete, we want to add a new disk
    1. with the VM selected, click the "Attach" button in the bottom menu bar
    2. set the disk size at 10GB and leave host cache pref set to none.
  4. Connect to the VM (using the connect button on the bottom nav)
  5. Next, we're going to create a Volume on the empty disk we attached
    1. Once connected/logged in to the Server, Go to Server Manager  and click on "File and Storage Services" either on the left menu or on the dashboard page itself
    2. When File and Storage Services opens, choose the "Disks" menu option and you should see your new 10GB disk.
    3. Right click on the 10GB Disk and choose "New Volume"
    4. You should be able to just keep clicking next and create the volume,  the only optional thing I did was give the volume a better name (I called mine ADDISK).  My drive letter defaulted to F, which was fine (remember this though when you're promoting the server to the AD Controller).
  6. Now we need to set a Static IP for the AD VM
    1. If you already have Azure Powershell installed, you can skip these steps:
      1. If you're on Windows 8+, click the start button and type "Web Platform Installer"
      2. If you don't have the Web Platform Installer installed, then install it and then launch it
      3. Choose Microsoft Azure Powershell and install it
    2. Run Azure Powershell by clicking the start button and then typing "Azure Powershell"
    3. Run the following commands:
      1. If you've set a default subscription or prefer to use the Get-AzureSubscription instead, you can skip this step:
        1. type the following and then press enter:
          Add-AzureAccount
        2. You'll then be prompted in a pop up window to "Sign in to Windows Azure Powershell", enter your credentials here.
        3. In my case I only have one Azure subscription so it automatically assigns it as the default.  If a different default was selected for you, you may need to run the Select-AzureSubscription command to set the default.
      2. Next run the following 3 commands:
        1. $azvm = Get-AzureVM -ServiceName mySubscriptionNameADSVC -Name myADVMName
        2. Set-AzureStaticVNetIP -IPAddress 10.0.0.4 -VM $azvm
        3. Update-AzureVM -VM $azvm.VM -ServiceName mySubscriptionNameADSVC -Name myADVMName
        4. **NOTE:  The reference material linked above does the above 3 lines in 1 line by piping, but I think the Azure novice probably appreciates the individual actions.
        5. Feel free to exit Azure Powershell
  7. Now we can (finally) install AD.  I'm doing this based on the instruction provided for the CriticalPath VM install guide, I'm just changing the names for my domain (but feel free to follow theirs verbatim)
    1. Log into the server and on the Server Manager Dashboard choose "Add Roles and Features".   
    2. You'll be asked to select the server, if you have multiple listed, choose the one you're logged in to.  When asked what roles to add choose "Active Directory Domain Services" and click through,  (Accept Prerequisites) and then just click through until you get to the Confirmation Page
    3. On the confirmation page, check the Restart checkbox and then click Install.
    4. Wait for the server to reboot (and kick you out of the RD session), then RD back in.
  8. Now you need to promote the server to a domain controller.
    1. In the Server Manager, you should now see an AD DS option in the left menu, select this and you can promote the server to a domain controller
    2. In the AD Domain Services Config Wizard, choose
      1. Create a new forest with your domain name, click next
      2. Keep the forest and domain functional level defaults and select a new password for DSRM, click next
      3. Click next on the DNS options
      4. Click next on Additional options
      5. On "Paths" change the drive letters to F (or whatever drive letter you chose for the additional disk we added to the VM during the VM setup)
      6. On review options, I like to save the Powershell Script, but you can just click Next if you don't want to view it.
      7. On the prereqs check, click Install when done (you'll get a few warnings, one will be that there's not a static IPv6 address, hopefully that doesn't bite me later...)
      8. Wait for the install to finish.
  9. Next you need to reset your DNS server
    1. In Server Manager, click Tools > DNS.
    2. In DNS Manager, right-click the name of the DNS server and click Properties.
    3. On the Forwarders tab, click the IP address of the forwarder and click Edit. Select the IP address and click Delete.
    4. Click OK to close the editor and Ok again to close the DNS server properties.
    5. Update the DNS server setting for the virtual network.
      1. Click Virtual Networks > double-click the virtual network you created > Configure > DNS servers, type the name and the DIP (internal IP Address, should be 10.0.0.4 if you followed my steps above) of the VM that runs the DC/DNS server role and click Save.
      2. Select the VM and click Restart to trigger the VM to configure DNS resolver settings with the IP address of the new DNS server.
  10. At this point you should have a working AD server, you may want to open up AD Users & Computers to verify you can see stuff (like the automatically created users and groups) and verify that your server is now in the new domain.
  11. We need to make two more changes before we leave though.  
    1. Go back to DNS Manager (Server Manager > Tools > DNS)  
      1. expand your server and expand forward lookup zones, 
      2. then right-click on your domain and under "Dynamic Updates" to change to  "Nonsecure and Secure", which will allow you to register from new VMs.
      3. restart if prompted after click ok.
    2. Then, set up your Primary DNS Suffix (you'll do this on any additional VMs you want to join)
      1. In Server Manager choose "Local Server" from the left navigation.   
      2. Click the Computer Name link (your server name)
      3. Click the "Change" button, you'll get a warning but it's ok (we're not going to change the name)
      4. Click the "More" button and type the Primary DNS suffix of this computer to be the domain you set up when you set up AD. Then click ok
      5. Click the "Change" button on the Computer Name tab
      6. Select the Radio button for "Domain" in the Member of section
      7. and type the name of the domain you created on your AD server.
  12. Restart your the server if prompted

Task 3: Create the VM for the SP Server and Join it to the domain

  1. Go to the "Virtual Machines" area of Azure.
  2. Click the "+NEW" button
  3. Choose Compute > Virtual Machine > From Gallery
  4. On Page 1, choose Windows Server 2012 R2 Datacenter then click the next arrow
  5. On Page 2,
    1. Give the VM a name
    2. Choose the Basic Tier (unless you've got a lot of credits to work with)
    3. For the size, choose A4 (8 cores, 14GB memory)  remember this is an SP Server that will run SQL, SP, and your developer tools (Visual Studio, etc) so you want to have a powerful VM
    4. Pick a username and password
  6. On Page 3,
    1. Choose to create a new cloud service and it's fine if this cloud service is named after the machine.   In this case, this is an SP2013 Standalone environment and there will only be one server in here, ever, so giving it its own cloud service should be fine.   In the future, if I want to stand up a multi server farm, I'll create a new Cloud service for my WFE's, App Servers, SQL, etc (as appropriate).
    2. Put this new server on your Virtual Network you created earlier.
    3. Use an Automatically generated storage account
    4. Keep availability set at "None".
  7. On Page 4, choose to install the VM Agent, then click the check button to start the provisioning process.
  8. Once provisioning is complete, make sure that your AD server is also running, if it's not, start it.
  9. Now select your newly created SP Standalone Server VM and connect to it.
  10. In Server Manager choose "Local Server" from the left navigation.   Click the "WORKGROUP" link under the Computer Name in the Properties area.
  11. Click the "More" button and type the Primary DNS suffix of this computer to be the domain you set up when you set up AD. Then click ok
  12. Click the "Change" button on the Computer Name tab
  13. Select the Radio button for "Domain" in the Member of section
  14. and type the name of the domain you created on your AD server.
  15. At this point you should be prompted for a Domain Admin login so that your machine can be added.    If you type it correctly you should get a welcome message.

Ok, next up is working with AutoSPInstaller to get a nice SharePoint developer VM baseline.

Reference:
  • https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-migrate-to-regional-vnet/
  • https://azure.microsoft.com/en-us/documentation/articles/active-directory-new-forest-virtual-machine/
  • http://www.cloudcomputingadmin.com/articles-tutorials/windows-azure/azure-virtual-networks-and-cloud-services-part1.html 
  • http://blogs.msdn.com/b/mcsuksoldev/archive/2014/03/04/creating-a-dns-server-in-azure-iaas.aspx


No comments: