How to use connect together a container on Azure Container Instance with a container on Azure Container app through a virtual network

Luca Maurelli 30 Reputation points
2023-07-07T11:32:45.77+00:00

I have a container 1 run on Azure Container Instance (pulled from Azure Container Registry). This works okay.

I have a container 2 run on Azure Container Apps (pulled from Azure Container Registry). This works okay.

Now I want container 1 to send a request on port X to container 2 on port Y (in my case X = Y). I tried creating the virtual network associated at the same time of its deployment, i.e. I create a custom container enviroment, and under networking I create a new virtual network and I accept the default proposed subnet. I also select the "internal" options as I don't need to expose the container to internet, I just need an internal communication between these two services.

When I redeploy container 1, though, I am not able to use the same virtual network/subnet as in container 2 (the option is greyed out):

User's image

What can I do to set-up correctly these two services? I am using the portal at the moment because I'm still learning these resource types of Azure. Thank you.

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
672 questions
Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
338 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AirGordon 7,030 Reputation points
    2023-07-07T17:45:52.6133333+00:00

    Both services require a dedicated subnet. Ensure you create two small subnets instead of 1.