简体   繁体   中英

Azure Create ARM Template To Create Vm In An Existing Vnet and Subnet

I want to deploy VM in the existing vnet and subnet. Instead of entering vnet and subnet name, can I get the list of vnet available in a Resource Group and make it as a user-selectable, same for subnet.

no, this is not possible, you need to do this with powershell, for example, and then pass that as an input to the ARM template. it would something like this:

$vnets = Get-AzVirtualNetwork
$vnet = $vnets | Out-GridView -PassThru
$subnet = $vnet.subnets | Out-GridView -PassThru
New-AzResourceGroupDeployment -param $subnet.id xxx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM