How to connect Azure Container Instance into another grouped VM?

wolverine 0 Reputation points
2023-12-04T08:12:01.28+00:00

I'm struggling to connect ACI into my Azure Virtual Machine which has mongoDB inside of it. ( normal Virtual Machine, not DB I just installed mongoDB into this VM )

What I already treid is, inbounding ACI's private / public IP in my VM ( for mongoDB ) network rule. But both private and public IP doesn't work. It only connected to the VM when I allow all the incoming Traffic in Network Rule...

I'm trying to use ACI for FE / BE application and run the Database as an isolated VM. That's why I wanna make ACI of my BE application to be connected into Virtual Machine.. with private ip.

please help with this issue.

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
687 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,738 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AlaaBarqawi_MSFT 942 Reputation points Microsoft Employee
    2023-12-05T07:25:23.1066667+00:00

    Hi @wolverine,

    i did following steps to repro the scenario can you confirm it :
    1)created Vnet with 2 subnet
    i used this sample as as , click deploy to Azure

    https://video2.skills-academy.com/en-us/samples/azure/azure-quickstart-templates/vnet-two-subnets/

    after create check the subnet

    User's image

    2-Create linux VM inside the Subnet1 as below

    User's image

    3-Create ACI instance with default image inside Subnet 2

    User's image

    Note: you cannot create ACI inside the VM subnet

    Also notice the delegation happened to subnet2 after ACI created , check the vnet1-->subnets

    4-connect to the ACI instance and try to ssh or nc to the VM private IP

    User's image

    User's image

    Connection successful using VM private IP inside Subnet1

    User's image

    I hope this help waiting your feedback

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.