From 102ac4d72cc6bc47acfcfad5af896df4fa4096c9 Mon Sep 17 00:00:00 2001 From: honcao Date: Tue, 24 Nov 2015 15:36:10 -0800 Subject: [PATCH 1/3] Add resource to download installation image --- sql-2014-non-ha/deploySqlStandalone.ps1.zip | Bin 164479 -> 167364 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/sql-2014-non-ha/deploySqlStandalone.ps1.zip b/sql-2014-non-ha/deploySqlStandalone.ps1.zip index f34f7b6693c07088b14476771f4bc7cc47b7639c..a590a902640171447f70df4fa7d370483b86acee 100644 GIT binary patch delta 6223 zcmbVQWmHvNw?1c+(#S!Y10r2g(jd}ZN_QN(k%j}3A_7ty3?twql1GBf$YGO zU*f=#^KJ`bS1-&8F2XynbFbmT?0t{*?)av(#_Fp2zi#r?>5EQGPnxn=oydi~oxKRL z77y#Vk#baB)UDEBI5@t)|6O=7W2t?;2WKQ_I0`EPf0+GjQEZQL*_+2AMLwnOde-as zddrv;JVgSp{>(CS-nQva$)Cs)lKl5-QH3A6k=jba1MqAnlZ6IG=I;kf-RoB#m@o1B z7Qi`wz)u?BeU@A|i%k01AC#-#f0`uz0Bgy^sCpem_yO133FUfya5&DO%zGktlQ^ej z7sD!EEPq6zs84$JP5%M-(XF<%PYicPv9UvLq=6Hvm15VWkzfhO#t?p<)^N_xKu@se zixikY^;r(Rz#v{7ucNs->>8G5GCyDv|8t3t!A~tC^h|hgYP-08-hc}MT}HLM=oRMT zqO7Hz74d`^im&F3$lR^Ke{ka9{{U<1U@bOAV{@xGjWddMJc34Se6w<}Qbownu@-aT zO5e&XrdPcceR@moIY&qDsaFC|4tf7v9kOVw0^_{tX!=lYFJe2?Qu9ac5nPhMxj1`u z+$(*3HRf}sWwcXob2ynrzg~YTvA6o2jUTeB3K#(&PweMDkoMG(ni&gMTmZD*2h{mG z92eu_Nz(A%R9MS~FG=JErixGsJ-p$0d*o&F4FBZ4+o!y>tfI0y(=NUrwelAm!C z$_;wV0-a^eEsiAXeHcP3^Rc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M~Z@>o`{gH}^RZ{%-1JKSNV9`o2 z-XExeSDPgFEddzfflP%wF&`+|2fc!TAY^1kOTdUgq>UcKE)j!kfk>ZX#vQ`IgXV?p zafmhGGGYzk+rcAZXd%e$kKp&)tA}9e4*e3xGlRY zXkmOPP^FTTM?)WV^g%co3b0h$3cnQ>JaPs60m@H7pDQ2%d^D#-8)zMd9Jay|%3KAW z5PcPy{PP8h$OD^>@H7FOf`SADI=NFsI2iJz*hHasIC2*5a3sU%w@XZbzWx0u|tv2OEgUn{_-y z3qpe^OcCX{O_f*;mK0~2tiWk-y3qNSkGb>y)%fb z8ftz*^T69ko~ouF4bc;5RyaUWB?D-J0*vFPXd&v4>z$$8kq=7r7R4fj1tg;&DQ~rYF^^EGTF6KLyLI8 zLp6%~&9N{i9=K6y$^A#E!6h}M*VP21*HHxk!!&>}Y^SJUMF0gg0Xt+$M6Q)ZA0A5t b+Q9x4Bqjn`21}GBYFz|{@;MJsDAd0IwMvqj From e8af15273f30560d536919474e6d8fd8a99e7ec3 Mon Sep 17 00:00:00 2001 From: charlesjoy Date: Tue, 24 Nov 2015 20:28:49 -0800 Subject: [PATCH 2/3] Several Template and Script Examples --- .../Example-Connect-to-AzureRM.ps1 | 23 ++ .../Example-Deploy-vNet.ps1 | 13 + .../azuredeploy-network.json | 115 ++++++++ .../azuredeploy-nsg.json | 36 +++ .../azuredeploy-vNet.json | 37 +++ .../azuredeploy-vNetandSG.json | 68 +++++ .../Example-Deploy-storageacct.ps1 | 15 ++ .../azuredeploy-storageacct.json | 43 +++ ...le-Deploy-AzureRM-Template-VM-Creation.ps1 | 26 ++ ...oy-101-simple-windows-vm-custom-disks.json | 248 ++++++++++++++++++ ...edeploy-101-simple-windows-vm-withDNS.json | 246 +++++++++++++++++ .../Example-Deploy-BGInfo-Extension.ps1 | 15 ++ .../Example-Deploy-CustomScript-Extension.ps1 | 15 ++ .../Example-Deploy-DSC-Extension.ps1 | 17 ++ .../Example-VMAccessAgent-nonTemplate.ps1 | 12 + .../azuredeploy-bginfo-and-customscript.json | 45 ++++ .../azuredeploy-bginfo.json | 30 +++ .../azuredeploy-customscript-command.json | 30 +++ .../azuredeploy-customscript-dns.json | 30 +++ .../azuredeploy-customscript-linux.json | 31 +++ .../azuredeploy-customscript-scriptfile.json | 43 +++ 21 files changed, 1138 insertions(+) create mode 100644 simple-template-examples/Example-Connect-to-AzureRM.ps1 create mode 100644 simple-template-examples/network-resource-creation/Example-Deploy-vNet.ps1 create mode 100644 simple-template-examples/network-resource-creation/azuredeploy-network.json create mode 100644 simple-template-examples/network-resource-creation/azuredeploy-nsg.json create mode 100644 simple-template-examples/network-resource-creation/azuredeploy-vNet.json create mode 100644 simple-template-examples/network-resource-creation/azuredeploy-vNetandSG.json create mode 100644 simple-template-examples/storage-resource-creation/Example-Deploy-storageacct.ps1 create mode 100644 simple-template-examples/storage-resource-creation/azuredeploy-storageacct.json create mode 100644 simple-template-examples/vm-creation/Example-Deploy-AzureRM-Template-VM-Creation.ps1 create mode 100644 simple-template-examples/vm-creation/azuredeploy-101-simple-windows-vm-custom-disks.json create mode 100644 simple-template-examples/vm-creation/azuredeploy-101-simple-windows-vm-withDNS.json create mode 100644 simple-template-examples/vm-extension-deployment/Example-Deploy-BGInfo-Extension.ps1 create mode 100644 simple-template-examples/vm-extension-deployment/Example-Deploy-CustomScript-Extension.ps1 create mode 100644 simple-template-examples/vm-extension-deployment/Example-Deploy-DSC-Extension.ps1 create mode 100644 simple-template-examples/vm-extension-deployment/Example-VMAccessAgent-nonTemplate.ps1 create mode 100644 simple-template-examples/vm-extension-deployment/azuredeploy-bginfo-and-customscript.json create mode 100644 simple-template-examples/vm-extension-deployment/azuredeploy-bginfo.json create mode 100644 simple-template-examples/vm-extension-deployment/azuredeploy-customscript-command.json create mode 100644 simple-template-examples/vm-extension-deployment/azuredeploy-customscript-dns.json create mode 100644 simple-template-examples/vm-extension-deployment/azuredeploy-customscript-linux.json create mode 100644 simple-template-examples/vm-extension-deployment/azuredeploy-customscript-scriptfile.json diff --git a/simple-template-examples/Example-Connect-to-AzureRM.ps1 b/simple-template-examples/Example-Connect-to-AzureRM.ps1 new file mode 100644 index 0000000..9d2e36e --- /dev/null +++ b/simple-template-examples/Example-Connect-to-AzureRM.ps1 @@ -0,0 +1,23 @@ +########### +# CONNECT # +########### + +# Add specific Azure Stack Environment +$AadTenantId = "3dc25382-d7d1-4e5a-ad19-2fb47f1571c2" #GUID Specific to the AAD Tenant + +Add-AzureRmEnvironment -Name 'Azure Stack' ` + -ActiveDirectoryEndpoint ("https://login.windows.net/$AadTenantId/") ` + -ActiveDirectoryServiceEndpointResourceId "https://azurestack.local-api/" ` + -ResourceManagerEndpoint ("https://api.azurestack.local/") ` + -GalleryEndpoint ("https://gallery.azurestack.local:30016/") ` + -GraphEndpoint "https://graph.windows.net/" + +# Get Azure Stack Environment Information +$env = Get-AzureRmEnvironment 'Azure Stack' + +# Authenticate to AAD with Azure Stack Environment +Add-AzureRmAccount -Environment $env -Verbose + +# Get Azure Stack Environment Subscription +$SubName = "Best Sub" +Get-AzureRmSubscription -SubscriptionName $SubName | Select-AzureRmSubscription \ No newline at end of file diff --git a/simple-template-examples/network-resource-creation/Example-Deploy-vNet.ps1 b/simple-template-examples/network-resource-creation/Example-Deploy-vNet.ps1 new file mode 100644 index 0000000..6f4329b --- /dev/null +++ b/simple-template-examples/network-resource-creation/Example-Deploy-vNet.ps1 @@ -0,0 +1,13 @@ +########## +# DEPLOY # +########## + +# Set Deployment Variables +$RGName = 'myRG001' +$depName = 'myVNDeployment001' + +# Deploy vNet Template +New-AzureRmResourceGroupDeployment ` + -Name $depName ` + -ResourceGroupName $RGName ` + -TemplateFile "c:\templates\azuredeploy-vNet.json" \ No newline at end of file diff --git a/simple-template-examples/network-resource-creation/azuredeploy-network.json b/simple-template-examples/network-resource-creation/azuredeploy-network.json new file mode 100644 index 0000000..eadcb24 --- /dev/null +++ b/simple-template-examples/network-resource-creation/azuredeploy-network.json @@ -0,0 +1,115 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": { + "nicName": "myNic", + "publicIPAddressName": "myPubIP", + "vnetName": "myVNet", + "nsgName": "myNsg", + "nsgID": "[resourceId('Microsoft.Network/networkSecurityGroups',variables('nsgName'))]", + "addressPrefix": "10.0.0.0/24", + "subnetName": "Subnet-1", + "subnetPrefix": "10.0.0.0/24", + "publicIPAddressType": "Dynamic", + "vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('vnetName'))]", + "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables ('subnetName'))]", + "publicIPAddressID": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]", + "numberOfInstances": 1 + }, + "resources": [ + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[variables('nsgName')]", + "location": "[resourceGroup().location]", + "properties": { + "securityRules": [ + { + "name": "rule1", + "properties": { + "protocol": "*", + "sourcePortRange": "*", + "destinationPortRange": "*", + "sourceAddressPrefix": "*", + "destinationAddressPrefix": "*", + "access": "Allow", + "priority": 101, + "direction": "Inbound" + } + } + ] + } + }, + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/publicIPAddresses", + "name": "[variables('publicIPAddressName')]", + "location": "[resourceGroup().location]", + "properties": { + "publicIPAllocationMethod": "[variables('publicIPAddressType')]" + } + }, + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/virtualNetworks", + "name": "[variables('vnetName')]", + "location": "[resourceGroup().location]", + "dependsOn": [ + "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]" + ], + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[variables('addressPrefix')]" + ] + }, + "subnets": [ + { + "name": "[variables('subnetName')]", + "properties": { + "addressPrefix": "[variables('subnetPrefix')]", + "networkSecurityGroup": { + "id": "[variables('nsgID')]" + } + } + } + ], + "dhcpOptions": { + "dnsServers": ["192.168.100.2"] + } + } + }, + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/networkInterfaces", + "name": "[concat(variables('nicName'), copyindex())]", + "location": "[resourceGroup().location]", + "copy": { + "name": "nicLoop", + "count": "[variables('numberOfInstances')]" + }, + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', variables('vnetName'))]" + ], + "properties": { + "ipConfigurations": [ + { + "name": "ipconfig1", + "properties": { + "privateIPAllocationMethod": "Dynamic", + "subnet": { + "id": "[variables('subnetRef')]" + }, + "loadBalancerInboundNatRules": [ + { + "id": "[concat(variables('lbID'),'/inboundNatRules/RDP-VM', copyindex())]" + } + ] + } + } + ] + } + } + ] +} \ No newline at end of file diff --git a/simple-template-examples/network-resource-creation/azuredeploy-nsg.json b/simple-template-examples/network-resource-creation/azuredeploy-nsg.json new file mode 100644 index 0000000..a1989ce --- /dev/null +++ b/simple-template-examples/network-resource-creation/azuredeploy-nsg.json @@ -0,0 +1,36 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": { + "networkSecurityGroupName": "mySG" + }, + "resources": [ + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[variables('networkSecurityGroupName')]", + "location": "[resourceGroup().location]", + "tags": { + "displayName": "NetworkSecurityGroup" + }, + "properties": { + "securityRules": [ + { + "name": "rule1", + "properties": { + "protocol": "*", + "sourcePortRange": "*", + "destinationPortRange": "*", + "sourceAddressPrefix": "*", + "destinationAddressPrefix": "*", + "access": "Allow", + "priority": 101, + "direction": "Inbound" + } + } + ] + } + } + ] +} \ No newline at end of file diff --git a/simple-template-examples/network-resource-creation/azuredeploy-vNet.json b/simple-template-examples/network-resource-creation/azuredeploy-vNet.json new file mode 100644 index 0000000..fca145d --- /dev/null +++ b/simple-template-examples/network-resource-creation/azuredeploy-vNet.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": { + "vnetName": "myVNet", + "addressPrefix": "10.0.0.0/24", + "subnetName": "Subnet-1", + "subnetPrefix": "10.0.0.0/24" + }, + "resources": [ + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/virtualNetworks", + "name": "[variables('vnetName')]", + "location": "[resourceGroup().location]", + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[variables('addressPrefix')]" + ] + }, + "subnets": [ + { + "name": "[variables('subnetName')]", + "properties": { + "addressPrefix": "[variables('subnetPrefix')]" + } + } + ], + "dhcpOptions": { + "dnsServers": ["192.168.100.2"] + } + } + } + ] +} \ No newline at end of file diff --git a/simple-template-examples/network-resource-creation/azuredeploy-vNetandSG.json b/simple-template-examples/network-resource-creation/azuredeploy-vNetandSG.json new file mode 100644 index 0000000..b248e90 --- /dev/null +++ b/simple-template-examples/network-resource-creation/azuredeploy-vNetandSG.json @@ -0,0 +1,68 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": { + "vnetName": "myVNet", + "nsgName": "myNsg", + "nsgID": "[resourceId('Microsoft.Network/networkSecurityGroups',variables('nsgName'))]", + "addressPrefix": "10.0.0.0/24", + "subnetName": "Subnet-1", + "subnetPrefix": "10.0.0.0/24" + }, + "resources": [ + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[variables('nsgName')]", + "location": "[resourceGroup().location]", + "properties": { + "securityRules": [ + { + "name": "rule1", + "properties": { + "protocol": "*", + "sourcePortRange": "*", + "destinationPortRange": "*", + "sourceAddressPrefix": "*", + "destinationAddressPrefix": "*", + "access": "Allow", + "priority": 101, + "direction": "Inbound" + } + } + ] + } + }, + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/virtualNetworks", + "name": "[variables('vnetName')]", + "location": "[resourceGroup().location]", + "dependsOn": [ + "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]" + ], + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[variables('addressPrefix')]" + ] + }, + "subnets": [ + { + "name": "[variables('subnetName')]", + "properties": { + "addressPrefix": "[variables('subnetPrefix')]", + "networkSecurityGroup": { + "id": "[variables('nsgID')]" + } + } + } + ], + "dhcpOptions": { + "dnsServers": ["192.168.100.2"] + } + } + } + ] +} \ No newline at end of file diff --git a/simple-template-examples/storage-resource-creation/Example-Deploy-storageacct.ps1 b/simple-template-examples/storage-resource-creation/Example-Deploy-storageacct.ps1 new file mode 100644 index 0000000..a9139f0 --- /dev/null +++ b/simple-template-examples/storage-resource-creation/Example-Deploy-storageacct.ps1 @@ -0,0 +1,15 @@ +########## +# DEPLOY # +########## + +# Set Deployment Variables +$storageacct = 'mystorage001' +$RGName = 'myRG001' +$depName = 'mySADeployment001' + +# Deploy Storage Account Template +New-AzureRmResourceGroupDeployment ` + -Name $depName ` + -ResourceGroupName $RGName ` + -TemplateFile "c:\templates\azuredeploy-storageacct.json" ` + -newStorageAccountName $storageacct \ No newline at end of file diff --git a/simple-template-examples/storage-resource-creation/azuredeploy-storageacct.json b/simple-template-examples/storage-resource-creation/azuredeploy-storageacct.json new file mode 100644 index 0000000..6ef1ea2 --- /dev/null +++ b/simple-template-examples/storage-resource-creation/azuredeploy-storageacct.json @@ -0,0 +1,43 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "newStorageAccountName": { + "type": "string", + "metadata": { + "description": "Name of the Storage Account" + } + }, + "storageAccountType": { + "type": "string", + "defaultValue": "Standard_LRS", + "allowedValues": [ + "Standard_LRS" + ], + "metadata": { + "description": "Storage Account type" + } + }, + "location": { + "type": "string", + "defaultValue": "local", + "allowedValues": [ + "local" + ], + "metadata": { + "description": "Location of storage account" + } + } + }, + "resources": [ + { + "type": "Microsoft.Storage/storageAccounts", + "name": "[parameters('newStorageAccountName')]", + "apiVersion": "2015-06-15", + "location": "[parameters('location')]", + "properties": { + "accountType": "[parameters('storageAccountType')]" + } + } + ] +} \ No newline at end of file diff --git a/simple-template-examples/vm-creation/Example-Deploy-AzureRM-Template-VM-Creation.ps1 b/simple-template-examples/vm-creation/Example-Deploy-AzureRM-Template-VM-Creation.ps1 new file mode 100644 index 0000000..d2bb4c2 --- /dev/null +++ b/simple-template-examples/vm-creation/Example-Deploy-AzureRM-Template-VM-Creation.ps1 @@ -0,0 +1,26 @@ +########## +# DEPLOY # +########## + +# Set Deployment Variables +$myNum = "001" #Modify this per deployment +$RGName = "myRG$myNum" +$myLocation = "local" +$myBlobStorageEndpoint = "blob.azurestack.local" + +# Create Resource Group for Template Deployment +New-AzureRMResourceGroup -Name $RGName -Location $myLocation + +# Deploy Simple IaaS Template +New-AzureRmResourceGroupDeployment ` + -Name "myDeploymen$myNum" ` + -ResourceGroupName $RGName ` + -TemplateFile "c:\templates\azuredeploy-101-simple-windows-vm-withDNS.json" ` + -deploymentLocation $myLocation ` + -blobStorageEndpoint $myBlobStorageEndpoint ` + -newStorageAccountName "mystorage$myNum" ` + -dnsNameForPublicIP "mydns$myNum" ` + -adminUsername "admin" ` + -adminPassword ("User@123" | ConvertTo-SecureString -AsPlainText -Force) ` + -vmName "myVM$myNum" ` + -windowsOSVersion "2012-R2-Datacenter" \ No newline at end of file diff --git a/simple-template-examples/vm-creation/azuredeploy-101-simple-windows-vm-custom-disks.json b/simple-template-examples/vm-creation/azuredeploy-101-simple-windows-vm-custom-disks.json new file mode 100644 index 0000000..ba5b8ae --- /dev/null +++ b/simple-template-examples/vm-creation/azuredeploy-101-simple-windows-vm-custom-disks.json @@ -0,0 +1,248 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "vmName": { + "type": "string", + "metadata": { + "description": "This is the name of your virtual machine" + } + }, + "osDiskUrlParam": { + "type": "string", + "metadata": { + "description": "URL to OS disk resource" + } + }, + "dataDiskUrlParam": { + "type": "string", + "metadata": { + "description": "URL to data disk resource" + } + }, + "dnsNameForPublicIP": { + "type": "string", + "metadata": { + "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." + } + }, + "adminUserName": { + "type": "string", + "metadata": { + "description": "UserName for the Virtual Machine" + } + }, + "adminPassword": { + "type": "securestring", + "metadata": { + "description": "Password for the Virtual Machine" + } + }, + "osType": { + "type": "string", + "allowedValues": [ + "windows", + "linux" + ], + "metadata": { + "description": "This is the OS that your VM will be running" + } + }, + "location": { + "type": "string", + "allowedValues": [ + "West US", + "East US", + "East Asia", + "Southeast Asia", + "West Europe", + "local" + ], + "metadata": { + "description": "Location where resources will be deployed" + } + }, + "vmSize": { + "type": "string", + "defaultValue": "Standard_A3", + "allowedValues": [ + "Standard_A1", + "Standard_A2", + "Standard_A3", + "Standard_A4" + ], + "metadata": { + "description": "This is the size of your VM" + } + } + }, + "variables": { + "networkApiVersion": "2015-05-01-preview", + "computeApiVersion": "2015-06-15", + "location": "[parameters('location')]", + "publicIPAddressName": "[concat(parameters('vmName'),'PublicIP')]", + "vmName": "[parameters('vmName')]", + "virtualNetworkName": "[concat(parameters('vmName'),'VNet')]", + "nicName": "[concat(parameters('vmName'),'Nic')]", + "addressPrefix": "10.0.0.0/24", + "subnet1Name": "mysubnet", + "subnet1Prefix": "10.0.0.0/24", + "publicIPAddressType": "Dynamic", + "vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]", + "subnet1Ref": "[concat(variables('vnetID'),'/subnets/',variables('subnet1Name'))]", + "networkSecurityGroupName": "SecurityGroup", + "osDiskUrl": "[parameters('osDiskUrlParam')]", + "dataDiskUrl": "[parameters('dataDiskUrlParam')]", + "osDiskVhdName": "[concat(variables('osDiskUrl'),'-',variables('vmName'),'.vhd')]", + "dataDiskVhdName": "[concat(variables('dataDiskUrl'),'-',variables('vmName'),'.vhd')]" + }, + "resources": [ + { + "apiVersion": "[variables('networkApiVersion')]", + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[variables('networkSecurityGroupName')]", + "location": "[parameters('location')]", + "tags": { + "displayName": "NetworkSecurityGroup" + }, + "properties": { + "securityRules": [ + { + "name": "rule1", + "properties": { + "protocol": "*", + "sourcePortRange": "*", + "destinationPortRange": "*", + "sourceAddressPrefix": "*", + "destinationAddressPrefix": "*", + "access": "Allow", + "priority": 101, + "direction": "Inbound" + } + } + ] + } + }, + { + "apiVersion": "[variables('networkApiVersion')]", + "type": "Microsoft.Network/publicIPAddresses", + "name": "[variables('publicIPAddressName')]", + "location": "[variables('location')]", + "properties": { + "publicIPAllocationMethod": "[variables('publicIPAddressType')]", + "dnsSettings": { + "domainNameLabel": "[parameters('dnsNameForPublicIP')]" + } + } + }, + { + "apiVersion": "[variables('networkApiVersion')]", + "type": "Microsoft.Network/virtualNetworks", + "name": "[variables('virtualNetworkName')]", + "location": "[variables('location')]", + "dependsOn": [ + "[concat('Microsoft.Network/networkSecurityGroups/', variables('networkSecurityGroupName'))]" + ], + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[variables('addressPrefix')]" + ] + }, + "subnets": [ + { + "name": "[variables('subnet1Name')]", + "properties": { + "addressPrefix": "[variables('subnet1Prefix')]", + "networkSecurityGroup": { + "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" + } + } + } + ], + "dhcpOptions": { + "dnsServers": ["192.168.100.2"] + } + } + }, + { + "apiVersion": "[variables('networkApiVersion')]", + "type": "Microsoft.Network/networkInterfaces", + "name": "[variables('nicName')]", + "location": "[variables('location')]", + "dependsOn": [ + "[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]", + "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]" + ], + "properties": { + "ipConfigurations": [ + { + "name": "ipconfig1", + "properties": { + "privateIPAllocationMethod": "Dynamic", + "publicIPAddress": { + "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]" + }, + "subnet": { + "id": "[variables('subnet1Ref')]" + } + } + } + ] + } + }, + { + "apiVersion": "[variables('computeApiVersion')]", + "type": "Microsoft.Compute/virtualMachines", + "name": "[variables('vmName')]", + "location": "[variables('location')]", + "dependsOn": [ + "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]" + ], + "properties": { + "hardwareProfile": { + "vmSize": "[parameters('vmSize')]" + }, + "osProfile": { + "computerName": "[variables('vmName')]", + "adminUsername": "[parameters('adminUsername')]", + "adminPassword": "[parameters('adminPassword')]" + }, + "storageProfile": { + "dataDisks": [ + { + "name": "[concat(variables('vmName'),'-dataDisk')]", + "lun": 0, + "createOption": "FromImage", + "image": { + "uri": "[variables('dataDiskUrl')]" + }, + "vhd": { + "uri": "[variables('dataDiskVhdName')]" + } + } + ], + "osDisk": { + "name": "[concat(variables('vmName'),'-osDisk')]", + "osType": "[parameters('osType')]", + "caching": "ReadWrite", + "createOption": "FromImage", + "image": { + "uri": "[variables('osDiskUrl')]" + }, + "vhd": { + "uri": "[variables('osDiskVhdName')]" + } + } + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]" + } + ] + } + } + } + ] +} \ No newline at end of file diff --git a/simple-template-examples/vm-creation/azuredeploy-101-simple-windows-vm-withDNS.json b/simple-template-examples/vm-creation/azuredeploy-101-simple-windows-vm-withDNS.json new file mode 100644 index 0000000..5c69cc3 --- /dev/null +++ b/simple-template-examples/vm-creation/azuredeploy-101-simple-windows-vm-withDNS.json @@ -0,0 +1,246 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "newStorageAccountName": { + "type": "string", + "metadata": { + "description": "Unique DNS Name for the Storage Account where the Virtual Machine's disks will be placed." + } + }, + "vmName": { + "type": "string", + "metadata": { + "description": "Name of the VM." + } + }, + "blobStorageEndpoint": { + "type": "string", + "defaultValue": "blob.azurestack.local", + "allowedValues": [ + "blob.azurestack.local", + "blob.core.windows.net" + ], + "metadata": { + "description": "Blob storage endpoint" + } + }, + + + "deploymentLocation": { + "type": "string", + "defaultValue": "local", + "allowedValues": [ + "local", + "westus", + "eastus" + ], + "metadata": { + "description": "Blob storage endpoint" + } + }, + "adminUsername": { + "type": "string", + "metadata": { + "description": "Username for the Virtual Machine." + } + }, + "adminPassword": { + "type": "securestring", + "metadata": { + "description": "Password for the Virtual Machine." + } + }, + "dnsNameForPublicIP": { + "type": "string", + "metadata": { + "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." + } + }, + "windowsOSVersion": { + "type": "string", + "defaultValue": "2012-R2-Datacenter", + "allowedValues": [ + "2008-R2-SP1", + "2012-Datacenter", + "2012-R2-Datacenter" + ], + "metadata": { + "description": "The Windows version for the VM. This will pick a fully patched image of this given Windows version. Allowed values: 2008-R2-SP1, 2012-Datacenter, 2012-R2-Datacenter." + } + } + }, + "variables": { + "location": "[parameters('deploymentLocation')]", + "imagePublisher": "MicrosoftWindowsServer", + "imageOffer": "WindowsServer", + "OSDiskName": "osdisk", + "nicName": "myVnic", + "addressPrefix": "10.0.0.0/24", + "subnetName": "mySubnet", + "subnetPrefix": "10.0.0.0/24", + "storageAccountType": "Standard_LRS", + "publicIPAddressName": "myPublicIP", + "publicIPAddressType": "Dynamic", + "vmStorageAccountContainerName": "vhds", + "vmSize": "Standard_A1", + "virtualNetworkName": "myVnet", + "vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]", + "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]", + "networkSecurityGroupName": "mySG" + }, + "resources": [ + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[variables('networkSecurityGroupName')]", + "location": "[variables('location')]", + "tags": { + "displayName": "NetworkSecurityGroup" + }, + "properties": { + "securityRules": [ + { + "name": "rule1", + "properties": { + "protocol": "*", + "sourcePortRange": "*", + "destinationPortRange": "*", + "sourceAddressPrefix": "*", + "destinationAddressPrefix": "*", + "access": "Allow", + "priority": 101, + "direction": "Inbound" + } + } + ] + } + }, + { + "type": "Microsoft.Storage/storageAccounts", + "name": "[parameters('newStorageAccountName')]", + "apiVersion": "2015-06-15", + "location": "[variables('location')]", + "properties": { + "accountType": "[variables('storageAccountType')]" + } + }, + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/publicIPAddresses", + "name": "[variables('publicIPAddressName')]", + "location": "[variables('location')]", + "properties": { + "publicIPAllocationMethod": "[variables('publicIPAddressType')]", + "dnsSettings": { + "domainNameLabel": "[parameters('dnsNameForPublicIP')]" + } + } + }, + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/virtualNetworks", + "name": "[variables('virtualNetworkName')]", + "location": "[variables('location')]", + "dependsOn": [ + "[concat('Microsoft.Network/networkSecurityGroups/', variables('networkSecurityGroupName'))]" + ], + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[variables('addressPrefix')]" + ] + }, + "subnets": [ + { + "name": "[variables('subnetName')]", + "properties": { + "addressPrefix": "[variables('subnetPrefix')]", + "networkSecurityGroup": { + "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" + } + } + } + ], + "dhcpOptions": { + "dnsServers": ["192.168.100.2"] + } + } + }, + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/networkInterfaces", + "name": "[variables('nicName')]", + "location": "[variables('location')]", + "dependsOn": [ + "[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]", + "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]" + ], + "properties": { + "ipConfigurations": [ + { + "name": "ipconfig1", + "properties": { + "privateIPAllocationMethod": "Dynamic", + "publicIPAddress": { + "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]" + }, + "subnet": { + "id": "[variables('subnetRef')]" + } + } + } + ] + } + }, + { + "apiVersion": "2015-06-15", + "type": "Microsoft.Compute/virtualMachines", + "name": "[parameters('vmName')]", + "location": "[variables('location')]", + "dependsOn": [ + "[concat('Microsoft.Storage/storageAccounts/', parameters('newStorageAccountName'))]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]" + ], + "properties": { + "hardwareProfile": { + "vmSize": "[variables('vmSize')]" + }, + "osProfile": { + "computerName": "[parameters('vmName')]", + "adminUsername": "[parameters('adminUsername')]", + "adminPassword": "[parameters('adminPassword')]" + }, + "storageProfile": { + "imageReference": { + "publisher": "[variables('imagePublisher')]", + "offer": "[variables('imageOffer')]", + "sku": "[parameters('windowsOSVersion')]", + "version": "latest" + }, + "osDisk": { + "name": "osdisk", + "vhd": { + "uri": "[concat('http://',parameters('newStorageAccountName'),'.', parameters('blobStorageEndpoint'), '/', variables('vmStorageAccountContainerName'),'/',variables('OSDiskName'),'.vhd')]" + }, + "caching": "ReadWrite", + "createOption": "FromImage" + } + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]" + } + ] + }, + "diagnosticsProfile": { + "bootDiagnostics": { + "enabled": "true", + "storageUri": "[concat('http://',parameters('newStorageAccountName'),'.', parameters('blobStorageEndpoint'))]" + } + } + } + } + ] +} \ No newline at end of file diff --git a/simple-template-examples/vm-extension-deployment/Example-Deploy-BGInfo-Extension.ps1 b/simple-template-examples/vm-extension-deployment/Example-Deploy-BGInfo-Extension.ps1 new file mode 100644 index 0000000..eec3259 --- /dev/null +++ b/simple-template-examples/vm-extension-deployment/Example-Deploy-BGInfo-Extension.ps1 @@ -0,0 +1,15 @@ +########## +# DEPLOY # +########## + +# Set Deployment Variables +$vmName = 'myVM001' +$RGName = 'myRG001' +$depName = 'myBGIDeployment001' + +# Deploy BGInfo Template +New-AzureRmResourceGroupDeployment ` + -Name $depName ` + -ResourceGroupName $RGName ` + -TemplateFile "c:\templates\azuredeploy-bginfo.json" ` + -vmName $vmName \ No newline at end of file diff --git a/simple-template-examples/vm-extension-deployment/Example-Deploy-CustomScript-Extension.ps1 b/simple-template-examples/vm-extension-deployment/Example-Deploy-CustomScript-Extension.ps1 new file mode 100644 index 0000000..94c90aa --- /dev/null +++ b/simple-template-examples/vm-extension-deployment/Example-Deploy-CustomScript-Extension.ps1 @@ -0,0 +1,15 @@ +########## +# DEPLOY # +########## + +# Set Deployment Variables +$vmName = 'myVM001' +$RGName = 'myRG001' +$depName = 'myCSDeployment001' + +# Deploy Custom Script Template +New-AzureRmResourceGroupDeployment ` + -Name $depName ` + -ResourceGroupName $RGName ` + -TemplateFile "c:\templates\azuredeploy-customscript-command.json" ` + -vmName $vmName \ No newline at end of file diff --git a/simple-template-examples/vm-extension-deployment/Example-Deploy-DSC-Extension.ps1 b/simple-template-examples/vm-extension-deployment/Example-Deploy-DSC-Extension.ps1 new file mode 100644 index 0000000..707d5cb --- /dev/null +++ b/simple-template-examples/vm-extension-deployment/Example-Deploy-DSC-Extension.ps1 @@ -0,0 +1,17 @@ +########## +# DEPLOY # +########## + +# Set Deployment Variables +$vmName = 'myVM001' +$RGName = 'myRG001' +$depName = 'myDSCDeployment001' + +# Deploy DSC Extension Template +New-AzureRmResourceGroupDeployment ` + -Name $depName ` + -ResourceGroupName $RGName ` + -TemplateFile "c:\templates\azuredeploy-dsc.json" ` + -TemplateParameterFile "C:\templates\azuredeploy-dsc.parameters.json" ` + -vmName $vmName ` + -timestamp (Get-Date) \ No newline at end of file diff --git a/simple-template-examples/vm-extension-deployment/Example-VMAccessAgent-nonTemplate.ps1 b/simple-template-examples/vm-extension-deployment/Example-VMAccessAgent-nonTemplate.ps1 new file mode 100644 index 0000000..ac1d350 --- /dev/null +++ b/simple-template-examples/vm-extension-deployment/Example-VMAccessAgent-nonTemplate.ps1 @@ -0,0 +1,12 @@ +$rgName = "myRG001" +$vmName = "myVM001" +$extName = "VMAccess" + +#Get VMAccessAgent Extension Info (throws error if notexists) +Get-AzureRmVMAccessExtension -ResourceGroupName $rgName -VMName $vmName -Name $extName + +# Set VMAccessAgent Extension (Reset Password) +Set-AzureRmVMAccessExtension -ResourceGroupName $rgName -VMName $vmName -Name $extName -UserName "admin" -Password "User@123" -Location "Local" + +# Remove VMAccessAgent Extension +Remove-AzureRmVMAccessExtension -ResourceGroupName $rgName -VMName $vmName -Name $extName \ No newline at end of file diff --git a/simple-template-examples/vm-extension-deployment/azuredeploy-bginfo-and-customscript.json b/simple-template-examples/vm-extension-deployment/azuredeploy-bginfo-and-customscript.json new file mode 100644 index 0000000..d166bfb --- /dev/null +++ b/simple-template-examples/vm-extension-deployment/azuredeploy-bginfo-and-customscript.json @@ -0,0 +1,45 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "vmName": { + "type": "string", + "metadata": { + "description": "Name of the existing VM to apply the VM Extensions to" + } + } + }, + "variables": { + }, + "resources": [ + { + "type": "Microsoft.Compute/virtualMachines/extensions", + "name": "[concat(parameters('vmName'),'/CustomScriptExtension')]", + "apiVersion": "2015-06-15", + "location": "[resourceGroup().location]", + "properties": { + "publisher": "Microsoft.Compute", + "type": "CustomScriptExtension", + "typeHandlerVersion": "1.4", + "settings": { + "commandToExecute": "md c:\\users\\public\\documents\\test" + } + } + }, + { + "type": "Microsoft.Compute/virtualMachines/extensions", + "name": "[concat(parameters('vmName'),'/BGInfo')]", + "apiVersion": "2015-06-15", + "location": "[resourceGroup().location]", + "properties": { + "publisher": "Microsoft.Compute", + "type": "BGInfo", + "typeHandlerVersion": "2.1", + "settings": { + "Properties": [ + ] + } + } + } + ] +} \ No newline at end of file diff --git a/simple-template-examples/vm-extension-deployment/azuredeploy-bginfo.json b/simple-template-examples/vm-extension-deployment/azuredeploy-bginfo.json new file mode 100644 index 0000000..cd2020e --- /dev/null +++ b/simple-template-examples/vm-extension-deployment/azuredeploy-bginfo.json @@ -0,0 +1,30 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "vmName": { + "type": "string", + "metadata": { + "description": "Name of the existing VM to apply BGInfo to" + } + } + }, + "variables": { + }, + "resources": [ + { + "type": "Microsoft.Compute/virtualMachines/extensions", + "name": "[concat(parameters('vmName'),'/BGInfo')]", + "apiVersion": "2015-06-15", + "location": "[resourceGroup().location]", + "properties": { + "publisher": "Microsoft.Compute", + "type": "BGInfo", + "typeHandlerVersion": "2.1", + "settings": { + "Properties": [ + ] + } + } + }] +} \ No newline at end of file diff --git a/simple-template-examples/vm-extension-deployment/azuredeploy-customscript-command.json b/simple-template-examples/vm-extension-deployment/azuredeploy-customscript-command.json new file mode 100644 index 0000000..4dd8f6b --- /dev/null +++ b/simple-template-examples/vm-extension-deployment/azuredeploy-customscript-command.json @@ -0,0 +1,30 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "vmName": { + "type": "string", + "metadata": { + "description": "Name of the existing VM to apply the custom script to" + } + } + }, + "variables": { + }, + "resources": [ + { + "type": "Microsoft.Compute/virtualMachines/extensions", + "name": "[concat(parameters('vmName'),'/CustomScriptExtension')]", + "apiVersion": "2015-06-15", + "location": "[resourceGroup().location]", + "properties": { + "publisher": "Microsoft.Compute", + "type": "CustomScriptExtension", + "typeHandlerVersion": "1.4", + "settings": { + "commandToExecute": "md c:\\users\\public\\documents\\test" + } + } + } + ] +} \ No newline at end of file diff --git a/simple-template-examples/vm-extension-deployment/azuredeploy-customscript-dns.json b/simple-template-examples/vm-extension-deployment/azuredeploy-customscript-dns.json new file mode 100644 index 0000000..a4ced32 --- /dev/null +++ b/simple-template-examples/vm-extension-deployment/azuredeploy-customscript-dns.json @@ -0,0 +1,30 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "vmName": { + "type": "string", + "metadata": { + "description": "Name of the existing VM to apply the custom script to" + } + } + }, + "variables": { + }, + "resources": [ + { + "type": "Microsoft.Compute/virtualMachines/extensions", + "name": "[concat(parameters('vmName'),'/CustomScriptExtension')]", + "apiVersion": "2015-06-15", + "location": "[resourceGroup().location]", + "properties": { + "publisher": "Microsoft.Compute", + "type": "CustomScriptExtension", + "typeHandlerVersion": "1.4", + "settings": { + "commandToExecute": "powershell -ExecutionPolicy Unrestricted Set-DnsClientServerAddress -InterfaceAlias Ethernet -ServerAddresses 192.168.100.2, 8.8.8.8" + } + } + } + ] +} \ No newline at end of file diff --git a/simple-template-examples/vm-extension-deployment/azuredeploy-customscript-linux.json b/simple-template-examples/vm-extension-deployment/azuredeploy-customscript-linux.json new file mode 100644 index 0000000..4aa977a --- /dev/null +++ b/simple-template-examples/vm-extension-deployment/azuredeploy-customscript-linux.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "vmName": { + "type": "string", + "metadata": { + "description": "Name of the existing VM to apply Linux custom script to" + } + } + + }, + "variables": { + }, + "resources": [ + { + "type": "Microsoft.Compute/virtualMachines/extensions", + "name": "[concat(parameters('vmName'),'/CustomScriptForLinux')]", + "apiVersion": "2015-06-15", + "location": "[resourceGroup().location]", + "properties": { + "publisher": "Microsoft.OSTCExtensions", + "type": "CustomScriptForLinux", + "typeHandlerVersion": "1.3", + "settings": { + "commandToExecute": "ifconfig" + } + } + } + ] +} \ No newline at end of file diff --git a/simple-template-examples/vm-extension-deployment/azuredeploy-customscript-scriptfile.json b/simple-template-examples/vm-extension-deployment/azuredeploy-customscript-scriptfile.json new file mode 100644 index 0000000..3c9a8f5 --- /dev/null +++ b/simple-template-examples/vm-extension-deployment/azuredeploy-customscript-scriptfile.json @@ -0,0 +1,43 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "vmName": { + "type": "string", + "metadata": { + "description": "Name of the existing VM to apply the custom script to" + } + }, + "scriptFile": { + "type": "string", + "metadata": { + "description": "Full path of the script file in blob storage (Azure or Azure Stack)" + } + }, + "scriptName": { + "type": "string", + "metadata": { + "description": "Full name of the script file (including extension) referenced in the scriptFile parameter" + } + } + }, + "variables": { + }, + "resources": [ + { + "type": "Microsoft.Compute/virtualMachines/extensions", + "name": "[concat(parameters('vmName'),'/CustomScriptExtension')]", + "apiVersion": "2015-06-15", + "location": "[resourceGroup().location]", + "properties": { + "publisher": "Microsoft.Compute", + "type": "CustomScriptExtension", + "typeHandlerVersion": "1.4", + "settings": { + "fileUris": [ "[parameters('scriptFile')]" ], + "commandToExecute": "[concat('powershell -ExecutionPolicy Unrestricted -file ',parameters('scriptName'))]" + } + } + } + ] +} \ No newline at end of file From a58a2a4a430566c602a933428bae7289989c49ca Mon Sep 17 00:00:00 2001 From: honcao Date: Mon, 30 Nov 2015 16:34:49 -0800 Subject: [PATCH 3/3] Update readme file --- ad-non-ha/Readme.md | 74 +++++--------------------------------- ad-non-ha/azuredeploy.json | 2 +- sql-2014-non-ha/Readme.md | 70 ++++-------------------------------- 3 files changed, 15 insertions(+), 131 deletions(-) diff --git a/ad-non-ha/Readme.md b/ad-non-ha/Readme.md index bab4d64..4c3be67 100644 --- a/ad-non-ha/Readme.md +++ b/ad-non-ha/Readme.md @@ -1,42 +1,20 @@ -# Create a SQL Server 2014 Always On Availability Group with PowerShell DSC Extension +# Create a AD domain controller server non-HA with PowerShell DSC Extension -This template will create a SQL Server 2014 Always On Availability Group using the PowerShell DSC Extension it creates the following resources: +This template will create a AD domain controller Server using the PowerShell DSC Extension; it creates the following resources: + A Virtual Network -+ Three Storage Accounts -+ One external and one internal load balancer -+ Two VMs configured as Domain Controllers for a new forest with a single domain -+ Three VMs in a Windows Server Cluster, two VMs run SQL Server 2014 with an availability group and the third is a File Share Witness for the Cluster -+ Two Availability Sets one for the AD VMs, the other for the SQL and Witness VMs, the second Availability Set is configured with three Update Domains and three Fault Domains ++ One Storage Account ++ One external load balancer ++ One VM configured as Domain Controller for a new forest with a single domain -The external load balancer creates an RDP NAT rule to allow connectivity to the first VM created, in order to access other VMs in the deployment this VM should be used as a jumpbox. - -A SQL Server always on listener is created using the internal load balancer. - -# Known Issues - -This template is entirely serial due to some issues between the platform agent and the DSC extension which cause problems when multiple VM and\or extension resources are deployed concurrently. This issue will be fixed as soon as possible. +The external load balancer creates an RDP NAT rule to allow connectivity to the AD VM created. ## Notes -+ The default settings for storage are to deploy using **premium storage**, the AD VMs use a P10 Disk and the SQL VMs use two P30 disks each, these sizes can be changed by changing the relevant variables. In addition there is a P10 Disk used for each VMs OS Disk. - -+ In default settings for compute require that you have at least 19 cores of free quota to deploy. - + The images used to create this deployment are + AD - Latest Windows Server 2012 R2 Image - + SQL Server - Latest SQL Server 2014 on Windows Server 2012 R2 Image - + Witness - Latest Windows Server 2012 R2 Image - -+ The image configuration is defined in variables - details below - but the scripts that configure this deployment have only been tested with these versions and may not work on other images. - - -Click the button below to deploy from the portal - - - - ++ The image configuration is defined in variables - details below - but the scripts that configure this deployment have only been tested with version mentioned above and may not work on other images. ## Deploying from PowerShell @@ -44,46 +22,10 @@ For details on how to install and configure Azure Powershell see [here].(https:/ Launch a PowerShell console -Ensure that you are in Resource Manager Mode - -```PowerShell - -Switch-AzureMode AzureResourceManager - ``` Change working folder to the folder containing this template ```PowerShell -New-AzureResourceGroup -Name "" -Location "" -TemplateParameterFile .\azuredeploy-parameters.json -TemplateFile .\azuredeploy.json +New-AzurermResourceGroupDeployment -Name "" -Location "" -TemplateParameterFile .\azuredeploy.azurestack.parameters.json -TemplateFile .\azuredeploy.json -``` - -You will be prompted for the following parameters - -+ **newStorageAccountNamePrefix:** - specify the prefix for the new storage account names -+ **locationFromTemplate:** - specify a valid location for the deployment -+ **adminPassword:** - the administrator password for the VMs and Domain -+ **sqlServerServiceAccountPassword:** the password for the account that SQL Server will run as -+ **dnsPrefix:** the DNS prefix for the public IP address used for RDP - -## Notable Variables - -|Name|Description| -|:---|:---------------------| -|virtualNetworkName|Name of the Virtual Network| -|adPDCVMName|The name of the Primary Domain Controller| -|adBDCVMName|The name of the Backup\Second Domain Controller| -|sqlVMName|The prefix for the SQL VM Names| -|sqlwVMName|The name of the File Share Witness| -|spwebVMName|The Prefix of the SharePoint Web Server VMs| -|rdpPort|The public RDP port for first VM| -|windowsImagePublisher|The name of the pulisher of the AD and Witness Image| -|windowsImageOffer|The Offer Name for the Image used by AD and Witness VMs| -|windowsImageSKU|The Image SKU for the AD and Witness Image| -|sqlImagePublisher|The name of the pulisher of the SQL Image| -|sqlImageOffer|The Offer Name for the Image used by SQL| -|sqlImageSKU|The Image SKU for the SQL Image| -|windowsDiskSize|The size of the VHD allocated for AD and Witness VMs Data Disk| -|sqlDiskSize|The size of the VHD allocated for SQL VMs Data and Log Disks| -|domainName|The name of the new AD Domain created| diff --git a/ad-non-ha/azuredeploy.json b/ad-non-ha/azuredeploy.json index 7e3fa53..05881e1 100644 --- a/ad-non-ha/azuredeploy.json +++ b/ad-non-ha/azuredeploy.json @@ -27,7 +27,7 @@ "type": "string", "defaultValue": "azurestack.local", "metadata": { - "description": "The address of Primary AD" + "description": "the storage account domain" } }, diff --git a/sql-2014-non-ha/Readme.md b/sql-2014-non-ha/Readme.md index bab4d64..cbcd662 100644 --- a/sql-2014-non-ha/Readme.md +++ b/sql-2014-non-ha/Readme.md @@ -1,89 +1,31 @@ -# Create a SQL Server 2014 Always On Availability Group with PowerShell DSC Extension +# Create a SQL Server 2014 Stand alone with PowerShell DSC Extension This template will create a SQL Server 2014 Always On Availability Group using the PowerShell DSC Extension it creates the following resources: + A Virtual Network -+ Three Storage Accounts -+ One external and one internal load balancer -+ Two VMs configured as Domain Controllers for a new forest with a single domain -+ Three VMs in a Windows Server Cluster, two VMs run SQL Server 2014 with an availability group and the third is a File Share Witness for the Cluster -+ Two Availability Sets one for the AD VMs, the other for the SQL and Witness VMs, the second Availability Set is configured with three Update Domains and three Fault Domains ++ Two Storage Accounts ++ One external load balancer ++ One VM configured as Domain Controller for a new forest with a single domain ++ One VM configured as SQL Server 2014 stand alone The external load balancer creates an RDP NAT rule to allow connectivity to the first VM created, in order to access other VMs in the deployment this VM should be used as a jumpbox. -A SQL Server always on listener is created using the internal load balancer. - -# Known Issues - -This template is entirely serial due to some issues between the platform agent and the DSC extension which cause problems when multiple VM and\or extension resources are deployed concurrently. This issue will be fixed as soon as possible. - ## Notes -+ The default settings for storage are to deploy using **premium storage**, the AD VMs use a P10 Disk and the SQL VMs use two P30 disks each, these sizes can be changed by changing the relevant variables. In addition there is a P10 Disk used for each VMs OS Disk. - -+ In default settings for compute require that you have at least 19 cores of free quota to deploy. - + The images used to create this deployment are + AD - Latest Windows Server 2012 R2 Image + SQL Server - Latest SQL Server 2014 on Windows Server 2012 R2 Image - + Witness - Latest Windows Server 2012 R2 Image + The image configuration is defined in variables - details below - but the scripts that configure this deployment have only been tested with these versions and may not work on other images. - -Click the button below to deploy from the portal - - - - - - ## Deploying from PowerShell For details on how to install and configure Azure Powershell see [here].(https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/) Launch a PowerShell console -Ensure that you are in Resource Manager Mode - -```PowerShell - -Switch-AzureMode AzureResourceManager - -``` Change working folder to the folder containing this template ```PowerShell -New-AzureResourceGroup -Name "" -Location "" -TemplateParameterFile .\azuredeploy-parameters.json -TemplateFile .\azuredeploy.json - -``` - -You will be prompted for the following parameters - -+ **newStorageAccountNamePrefix:** - specify the prefix for the new storage account names -+ **locationFromTemplate:** - specify a valid location for the deployment -+ **adminPassword:** - the administrator password for the VMs and Domain -+ **sqlServerServiceAccountPassword:** the password for the account that SQL Server will run as -+ **dnsPrefix:** the DNS prefix for the public IP address used for RDP - -## Notable Variables - -|Name|Description| -|:---|:---------------------| -|virtualNetworkName|Name of the Virtual Network| -|adPDCVMName|The name of the Primary Domain Controller| -|adBDCVMName|The name of the Backup\Second Domain Controller| -|sqlVMName|The prefix for the SQL VM Names| -|sqlwVMName|The name of the File Share Witness| -|spwebVMName|The Prefix of the SharePoint Web Server VMs| -|rdpPort|The public RDP port for first VM| -|windowsImagePublisher|The name of the pulisher of the AD and Witness Image| -|windowsImageOffer|The Offer Name for the Image used by AD and Witness VMs| -|windowsImageSKU|The Image SKU for the AD and Witness Image| -|sqlImagePublisher|The name of the pulisher of the SQL Image| -|sqlImageOffer|The Offer Name for the Image used by SQL| -|sqlImageSKU|The Image SKU for the SQL Image| -|windowsDiskSize|The size of the VHD allocated for AD and Witness VMs Data Disk| -|sqlDiskSize|The size of the VHD allocated for SQL VMs Data and Log Disks| -|domainName|The name of the new AD Domain created| +New-AzurermResourceGroupDeployment -Name "" -Location "" -TemplateParameterFile .\azuredeploy.azurestack.parameters.json -TemplateFile .\azuredeploy.json