[VM] How to specify virtual network from another resource group?
See original GitHub issueHi, I have an issue with azure-cli (0.1.1b3).
I have a virtual network “vn1” in a resource group “rg-network”. I have a resource group “rg-machine” in which I want to create a new VM.
When using az vm create --resource-group "rg-machine" --vnet-name "vn1" [...]
, a new virtual network is created in “rg-machine” instead of using the existing one in “rg-network”.
Both networks have the exact same name (“vn1”). Is this the expected behavior ? How can we use networks from another resource group ?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:15 (5 by maintainers)
Top Results From Across the Web
Can virtual network be in different Resource Group while ...
Yes, you can use the Vnet in the different resource group. But the limitation is your Vnet and VM must be in the...
Read more >Share Virtual Network between Resource Groups - ITPro Today
Q. How do I share a virtual network in one Azure Resource Group to another Resource Group? A. A resource can only exist...
Read more >Plan virtual networks - Azure - Microsoft Learn
Learn how to plan for virtual networks based on your isolation, connectivity, and location requirements.
Read more >How-to Guide: Create and use Azure Virtual Network ... - Vembu
Creating a new resource group – A resource group is a container that holds related resources for an Azure solution. Provide a name...
Read more >Set Up Azure resource group and networking - Elastic
Create a resource group: az group create · name ; Create your network security group: az network nsg create · group ; Create...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, this is the expected behavior. If you want to use a VNET in the other resource group you should supply the fully qualified ID for the subnet in the other resource group you wish to use. If you supply the subnet ID, do not supply vnet-name (you’ll get an error). It gets automatically parsed out of the subnet ID.
Instead of using
-o json
, try-o tsv
. That will eliminate the quotes