-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Crowell
authored and
Crowell
committed
Apr 4, 2017
1 parent
c0f31e1
commit 96af3c4
Showing
3 changed files
with
52 additions
and
12 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
json_deployment_templates/vch-iaas-deployment/azuredeploy.parameters.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"adminPassword": { | ||
"reference": { | ||
"keyVault": { | ||
"id": "/subscriptions/4830d36a-e5da-4f38-8647-b8ca702c1b1d/resourceGroups/vchds-root-rg/providers/Microsoft.KeyVault/vaults/vchDsKeyVault" | ||
}, | ||
"secretName": "VmAdminPassword" | ||
} | ||
} | ||
// "dnsLabelPrefix": { | ||
// "value": "GEN-UNIQUE" | ||
// }, | ||
// "windowsOSVersion": { | ||
// "value": "2012-R2-Datacenter" | ||
// } | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
Set-Location -Path $PSScriptRoot | ||
$template_path = Join-Path -Path $PSScriptRoot -ChildPath "template.json" | ||
$template_path = "template.json" | ||
Login-AzureRmAccount | ||
$parameter_path = "azuredeploy.parameters.json" | ||
# Login-AzureRmAccount | ||
# Set-AzureRmContext -SubscriptionID {your-subscription-ID} | ||
New-AzureRmResourceGroup -Name rg1 -Location "canadacentral" | ||
Test-AzureRmResourceGroupDeployment -ResourceGroupName rg1 -TemplateFile $template_path -Verbose -Debug | ||
New-AzureRmResourceGroupDeployment -Name rg1 -ResourceGroupName rg1 -TemplateFile $template_path | ||
|
||
$Secret = Read-Host -AsSecureString -Prompt "Enter VM local admin password. `nIt will save/OVERWRITE secret: VmAdminPassword `nin Key vault: vchDsKeyVault" | ||
# save pass word to Azure Key Vault | ||
Set-AzureKeyVaultSecret -VaultName 'vchDsKeyVault' -Name 'VmAdminPassword' -SecretValue $Secret | ||
# enable Key Vault for template deployment | ||
Set-AzureRmKeyVaultAccessPolicy -VaultName 'vchDsKeyVault' -EnabledForTemplateDeployment | ||
|
||
New-AzureRmResourceGroup -Name rg2 -Location "canadacentral" | ||
Test-AzureRmResourceGroupDeployment -ResourceGroupName rg2 -TemplateFile $template_path -TemplateParameterFile $parameter_path -Verbose -Debug | ||
New-AzureRmResourceGroupDeployment -Name gcdeployment -ResourceGroupName rg2 -TemplateFile $template_path -TemplateParameterFile $parameter_path |
This file contains 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