Thank you for reaching out.
I understand you wish to access your container app from your on-prem devices which are connected to Azure using S2S VPN.
You can follow the steps mentioned below and see if you are able to establish the connectvity.
- Deploy the Container App in a Custom VNET with internal Azure Container Apps environment as shown here. You need to create the container app in an internal environment because you have to restrict inbound requests to the environment exclusively to the VNet as the VPN connectivity happens over a private network.
- After the above step is done, Peer the Custom VNET above with the VNET where your S2S VPN (S2S VNET) is deployed. You can follow the documentation here to Peer these VNETS. Virtual network peering seamlessly connects two Azure virtual networks, merging the two virtual networks into one for connectivity purposes. Please do not forget to enable the Gateway transit peering property that will let the Custom VNET use the VPN gateway in the peered S2S VNET for cross-premises connectivity.
- The Next step will be to create Private DNS Zone for DNS resolution as described here to use Non-custom domains. Create a private DNS Zone named as the Container App environment’s default domain (
<UNIQUE_IDENTIFIER>.<REGION_NAME>.azurecontainerapps.io
), with anA
record. TheA
record contains the name*<DNS Suffix>
and the static IP address of the Container Apps environment. You can follow the Steps mentioned here to create a Private DNS zone as shown below (Just follow the private DNS zone step)
Example of the private DNS zone
Example of the A record.
The static IP of the container App can be obtained from custom domain page of the app from the portal as shown below:
- The next step will be to link the Custom VNET and S2S VNET to the private DNS zone above. Please follow the step shown here to link each VNET.
- After this step you should be able to access the container app URL from the VM deployed in your S2S VNET
To test you can do a nslookup test as shown below from the VM deployed in S2S VNET. This will help validate that the steps above were correctly followed until now.
- Now that container app is accessible from VNET where S2S VPN is deployed(S2S Vnet). The next will be to deploy an Azure Private DNS resolver so that the container app URL is resolved from the On-prem Devices. You can follow this tutorial to deploy Azure Private DNS resolver
As you have already configured S2S VPN Gateway and the connection is successful, I do not think you need to modify any configuration there. Just make sure that all the required routes are advertised.
Hope this helps! Please let me know if you have any additional questions. Thank you!
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.