Created
July 19, 2018 14:53
-
-
Save johnmmoss/ebeb5d4a9dd35b6eee19f8f749d91534 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$subscription_id_test = "<guid>" | |
$ScriptPath = Split-Path $MyInvocation.InvocationName | |
$templateFile = "$ScriptPath\WebApi\WebSite.json" # Sample Azure Template | |
$name = "TestWebApi" | |
$hostPlan = "F1" # Defined in the parameters in template | |
write-host Importing azure module -ForegroundColor gray | |
Import-Module -Name AzureRM | |
write-host Connecting... -ForegroundColor gray | |
Connect-AzureRMAccount | |
write-host Selecting subscription -ForegroundColor gray | |
Select-AzureRmSubscription $subscription_id_test | |
$resourceGroup = read-host "ENTER Resource group name" | |
$resourceGroupLocation = read-host "ENTER Resource group name location" | |
write-host Creating resource group $resourceGroup | |
New-AzureRmResourceGroup -Name $resourceGroup -Location $ResourceGroupLocation -Verbose -Force | |
write-host Creating file from template $template -ForegroundColor gray | |
$parameters = @{} | |
$parameters.Add("hostingPlanName", $hostPlan) | |
New-AzureRmResourceGroupDeployment -Name $name -ResourceGroupName $resourceGroup -TemplateFile $templateFile -TemplateParameterObject $parameters -Force -Verbose #-ErrorVariable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment