Quick start ARM templates that deploy on Microsoft Azure Stack
######################################
######################################
$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/"
$env = Get-AzureRmEnvironment 'Azure Stack'
Add-AzureRmAccount -Environment $env -Verbose
$SubName = "Best Sub" Get-AzureRmSubscription -SubscriptionName $SubName | Select-AzureRmSubscription
##################################
##################################
$myNum = "001" #Modify this per deployment $RGName = "myRG$myNum" $myLocation = "local" $myBlobStorageEndpoint = "blob.azurestack.local"
New-AzureRMResourceGroup -Name $RGName -Location $myLocation
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"
########################################
########################################
$vmName = 'myVM001' $RGName = 'myRG001' $depName = 'myDSCDeployment001'
New-AzureRmResourceGroupDeployment -Name $depName
-ResourceGroupName $RGName -TemplateFile "c:\templates\azuredeploy-dsc.json"
-TemplateParameterFile "C:\templates\azuredeploy-dsc.parameters.json" -vmName $vmName
-timestamp (Get-Date)
######################################
######################################
$vmName = 'myVM001' $RGName = 'myRG001' $depName = 'myCSDeployment001'
New-AzureRmResourceGroupDeployment -Name $depName
-ResourceGroupName $RGName -TemplateFile "c:\templates\azuredeploy-customscript-command.json"
-vmName $vmName
###############################
###############################
$vmName = 'myVM001' $RGName = 'myRG001' $depName = 'myBGIDeployment001'
New-AzureRmResourceGroupDeployment -Name $depName
-ResourceGroupName $RGName -TemplateFile "c:\templates\azuredeploy-bginfo.json"
-vmName $vmName
##################################
##################################
$storageacct = 'mystorage001' $RGName = 'myRG001' $depName = 'mySADeployment001'
New-AzureRmResourceGroupDeployment -Name $depName
-ResourceGroupName $RGName -TemplateFile "c:\templates\azuredeploy-storageacct.json"
-newStorageAccountName $storageacct
########################
########################
$RGName = 'myRG001' $depName = 'myVNDeployment001'
New-AzureRmResourceGroupDeployment -Name $depName
-ResourceGroupName $RGName `
-TemplateFile "c:\templates\azuredeploy-vNet.json"
$rgName = "myRG001" $vmName = "myVM001" $extName = "VMAccess"