question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[VM] How to specify virtual network from another resource group?

See original GitHub issue

Hi, 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:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

9reactions
tjprescottcommented, Feb 17, 2017

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.

3reactions
tjprescottcommented, Feb 9, 2018

Instead of using -o json, try -o tsv. That will eliminate the quotes

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found