Azure regions

binod ranabhat 1 Reputation point


Using Bicep template to deploy virtual machine in my subscription.

Trying to deploy in Resource Group1 lets say, but the vnet is in resource Group2.

They both are in same regions.

But using the Azure bicep template I want to use existing vnet and subnet to provision vm there, but keeps throwing error,

Please make sure that the referenced resource exists, and that both resources are in the same region

Any IDEA ?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
5,930 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. K Sheahan Kularathne 426 Reputation points

    You can create a VM using Vnet with a deferent RG. You can test this using the below template.

    If above is working, then it has to do something with the bicep code. You can review the json file to get an idea.

    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.