0

I need to deploy Azure container instance in differents Resource Groups.

In one Resource Group I allocate only the ACI and on another Resource Group I allocate the Vnet

Is this possible? I think that is not possible by design

exitista
  • 563
  • 2
  • 10
  • 21

2 Answers2

1

It's possible.

You can create an azure container instance in a virtual network that is in a different resource group from the container instance resource group.

Suppose you have created a vNet myvnet and subnet aci-subnet in the RG myvnetRG for your ACI. Then you could use the following deployment examples.

VnetId=$(az network Vnet show -g myvnetRG -n myvnet --query 'id' -o tsv)
az container create -n appcontainer -g containerRG --image mcr.microsoft.com/azuredocs/aci-helloworld --vnet $VnetId --subnet aci-subnet

You can also deploy a container group to an existing virtual network by using a YAML file, then specify several additional properties like network profile and ID in the YAML.

Nancy
  • 26,865
  • 3
  • 18
  • 34
0

It is possible by design, but why would you want to do that? It is not a recommended design thought.

If your resource groups in the different regions, you could configure a Vnet-to-Vnet connection. For your reference:

https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-howto-vnet-vnet-resource-manager-portal

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396