another technical blog...technically

Friday, November 21, 2014

Provision a SharePoint 2013 farm with Azure and PowerShell

I begun to work on Azure one year ago in order to have a dev SharePoint 2013 to build some code since i don't have a powerful PC.
Reading below articles, i was able to create my personal farm
Step-by-Step: Build a FREE SharePoint 2013 Dev/Test Lab in the Cloud with Windows Azure Infrastructure Services - Part 1
Step-by-Step: Build a FREE SharePoint 2013 Dev/Test Lab in the Cloud with Windows Azure Infrastructure Services - Part 2
A colleague (codename Roller) asked me if it was possible to build the farm automagically using PowerShell, since there were amazing PowerShell Azure cmdlets.
<< Varro, why don't you do something like that? it would be so useful >>
<< Ok Roller, but it will take a lot of my free time, you'll give me money for this? >>
<< No >>
<< Ok Roller, i'll do it for you ... someday... in the future >>
That day is arrived.
/mode joke off
Since i need something simple and smart to build a SP2013 farm, i started surfing the web studying (and also stealing code) creating this wonderful script you can download clicking here.

Requirements
Once you downloaded the script on you PC you have to read the README (do it).
It explains what do you need to make script execution smooth (maybe).
  1. Enable PSRemoting on your PC: this will be useful to use CredSSP to invoke remote PowerShell script execution on Azure machine (it will avoid the double hop problem); since you have to allow PSRemoting to *.cloudapp.net you are future-powershell-experiments proof.
  2. Download Azure cmdlets
  3. Download your Azure account publish settings (have you got a Azure account uh?).
  4. Configure XML file
The zip contains a Config - example.xml

 
 
 
  
  
 
 
 
  
 
 
  
   
  
  
   
  
  
   
   
  
 

If you don't want to waste you time, simply change "MSDN subscription name" with your MSDN subscription name, passwords (substitute Password01 with your preferred one) and substitute "sharepointLab01" prefix with something else (please note that resulting vm name length must be less than 15 characters).
Note that if you are behind proxyes, firewall and other stuffs, you could have troubles.
Please take some minutes to read the FAQ below, since you'll need it, after thas warm-up phase, simply run BuildEnvironment.ps1

FAQ.
Q1: What is the average execution time of the batch script?
A1: The farm will be provisioned approximately in 1 hour, i could make it quicker, better, safer... but you have the code, make it better :) .

Q2: The script is someway interactive?
A2: No, you will be prompted to proceed to WinRM quick configuration just one time, when provisioning SharePoint VM, click y and everything will be fine


Q3: I noticed the script sometimes stop itself and give me some error, what i have to do?
A3: Simply solve the errors and re-run the script: already done steps will be bybassed if possible

Q4: I received this error: "Connecting to remote server failed with the following message: The client cannot connect to the destination specified in the request blablabla" what i have to do?
A4: Just keep calm and re-run the script. This error means the script is unable to connect to the VM, so if you're ok with firewall, proxyes and other security stuffs, the connection simply failed, try again.
If the problem persists, try something more rude, delete the VM giving problems and re-run the scipt.

Q5: Are there some built-in users?
A5: Yes sir, SPFarm, which is also the farm admin and SPServiceApp

Q6:What about the service application?
A6: The script provisions User Profile, Managed Metadata and Search service applications, but you can do che quick wizard whenever you want if you need more

Happy ending (hope so)
Download the code from here and have fun. 

Remember, this is not production software, it's something i use for me, myself and i, so i cannot ensure you everything is gonna be fine, even if i provisioned some farm with this, but if i'll save you time with this... come on offer me a beer ;) .

In loving memory of Roller
written in: Milano, Italia

0 commenti:

Post a Comment

Because of a lot of SPAM about courses, I need to moderate all comments here.
I ensure you that I will answer whenever possible (if you are not a spammer).

Me, myself and I

My Photo
I'm just another IT guy sharing his knowledge with all of you out there.
Wanna know more?