Windows Azure Scripting Center | Get Started with Windows Azure PowerShell | Windows
Azure Infrastructure Scripts
Description
This script creates a SQL Server AlwaysOn availability group in a hybrid IT environment (a virtual network in Windows Azure with a site-to-site VPN with your on-premise network) end-to-end, including the following steps:
- Create the Windows Azure storage account, cloud services, and virtual machines
- Optionally, create a domain controller replica in Windows Azure (requires domain administration privileges)
- Creates a 4-node WSFC cluster for SQL Server AlwaysOn, with 3 nodes on-premise and 1 node in Windows Azure
- Create a 3-replica availability group (2 replicas on-premise and 1 replica in Windows Azure) and an availability group listener
- Verify that the availability group listener can accept client connection
This script uses two other scripts on TechNet Script Center (included in the .ZIP file):
For any feedback or question, please contact
Cephas Lin.
Steps
Input to the script is specified via DeploymentConfig.xml in the Config\ folder. You must change the configuration parameters in DeploymentConfig.xml to reflect your Windows Azure subscription and your on-premise configuration. Pay
attention to the following:
- In the ServiceAccounts element, where you list the account usernames and passwords for accounts specified elsewhere in the XML file, pay attention to any special characters (which are “ & ‘ < >) you may have in the
Password attribute. If any one of these characters exist, you must render them as
&name; (respectively: " & ' < >). For more information, see
Predefined entities in XML.
- The account with Type=”DBA” is used for creating the windows cluster and the availability group. Therefore, it needs to have rights to create computer objects in the domain’s Computers container.
- In VMRole Name="DomainControllers", you wish to create a DC replica in Windows Azure, set the
Create attribute to True.
- Specify the DomainAdminAccountName attribute with an account with rights to join computers to the domain. If you also want to create a DC replica, then the account must also be a domain administrator. Make sure that you include the account’s
username and password in ServiceAccounts.
- In the OnPremNodes element, specify the three on-premise servers.
- In the ActiveDirectory element , specify your domain details.
- In the SQLCluster element, specify your cluster and availability group details.
Then, run the following:
PowerShell
Edit|Remove
powershell
cd <ScriptFolder>
Unblock-File *
Set-ExecutionPolicy Unrestricted -Force
.\Deploy.ps1
cd <ScriptFolder>
Unblock-File *
Set-ExecutionPolicy Unrestricted -Force
.\Deploy.ps1
Scenario
You want to deploy the data tier of your application end-to-end using SQL Server databases in a high availability configuration on-premise, but you also want a disaster recovery solution in Windows Azure. The application tier can be added on to the deployed
architecture, and clients can connect to the databases from either within Windows Azure or the public Internet.
Requirements
- PowerShell 3.0
- Windows Azure PowerShell 0.6.18 or later
- Connection to your Windows Azure subscription in a Windows Azure PowerShell session (Get-AzureSubscription –Current returns a value). To connect the PowerShell session to your subscription, use
Get-AzurePublishSettingsFile and
Import-AzurePublishSettingsFile.
- A virtual network in your Windows Azure subscription with a functional site-to-site VPN with your on-premise network
- User credentials with necessary domain credentials (see Steps above)
- An available on-premise IP address to use for the availability group listener
- Three (3) on-premise servers with the following configuration:
- Windows Azure Data Management Scripts
- Windows Server 2012 on all servers
- SQL Server 2012 on intended primary and secondary replicas, with BUILTIN\Administrator as sysadmin
- Remote management enabled (default)
See Also