azure - How to update existing AzureRm virtual network using PowerShell? -


context

i have existing rm virtual network, , add new subnet using powershell:

# create subnet config: $besub = new-azurermvirtualnetworksubnetconfig -name $besubname -addressprefix $besubprefix  # vnet $vnet  = get-azurermvirtualnetwork -name $vnetname -resourcegroupname $vmresourcegroup  # add subnet: add-azurermvirtualnetworksubnetconfig -name $besubname -addressprefix $besubprefix -virtualnetwork $vnet  

all commands run no subnet added virtual network.

what i've try far:

  • originally i've thought there should update-azurermvirtualnetwork, there no such command.
  • i've searched new-azurermvirtualnetworksubnet, has -virtualnetwork $vnet parameter no success.

question

how can add new rm subnet existing rm virtual network?

you close. you're creating config not getting applied. script below you.

# vnet $vnet  = get-azurermvirtualnetwork -name $vnetname -resourcegroupname $vmresourcegroup  # add subnet config vnet: add-azurermvirtualnetworksubnetconfig -name $besubname -addressprefix $besubprefix -virtualnetwork $vnet   # apply subnet config vnet: set-azurermvirtualnetwork -virtualnetwork $vnet 

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -