Container app traffic restriction

Diana C 0 Reputation points
2025-03-07T10:31:13.4733333+00:00

In trying to strengthen the security on a resource group (containing app services, container apps and other resources) I tried to further secure the container apps with a network security group. However, it seems like this is no longer possible as the container apps are already up and running, and we would have needed to create a vnet when creating them, which was not the case. Alright. So I tried to go the route of restricting which IPs are allowed to access each container app. The only place I found this configuration was on the Ingress tab, where I selected "Allow traffic from IPs configured below, deny all other traffic". While this worked fine on the ingress endpoint (my-app-container--a1b2c3.[...].azurecontainerapps.io), it did not work on the custom domain defined for the container app (app-container-readable-name.com), where I get RBAC: access denied error. Plus there is the risk that the next deploy will change the suffix on the endpoint with the next replica name.

Do I need to whitelist certain IPs from Microsoft in order for the custom domain translation to happen? Or is there another setting I must change? Or another place where to restrict the incoming traffic?

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
572 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Khadeer Ali 3,830 Reputation points Microsoft External Staff
    2025-03-12T12:59:04.6533333+00:00

    @Diana C ,

    Based on our discussions and feedback from the Container Apps team, summarizing the possible ways

    1. Using Private Endpoints with Azure Front Door (Recommended Approach)
    • Enabling Private Endpoints for your Container Apps eliminates all external access.
    • When combined with Azure Front Door (AFD), only requests from your registered inbound domain (via AFD) will be allowed.
    • This approach ensures a secure, controlled entry point while keeping your resources private.

    To enable communication between your App Services and Container App, you can:

    • Place both services in the same VNet and configure networking to route traffic through the same private endpoint.
    • Alternatively, set up separate private endpoints for different applications based on your access control needs.
    • This will effectively restrict access to only the required resources within the VNet while preventing unwanted external traffic.

    But as you have mentioned Container Apps must be placed in a VNet at the time of creation, and currently, Azure does not support moving an existing Container App into a VNet after deployment.

    1. Alternative Approach: Whitelisting Microsoft Regional Service IPs

    If transitioning to Private Endpoints is not feasible, another option is to whitelist Microsoft’s regional service IP ranges in the IP restriction settings. However, there are some considerations:

    • Microsoft updates these IP ranges weekly, requiring frequent allowlist updates.
    • The latest IP ranges can be obtained from Azure Datacenter IP Ranges.

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.