An Azure service that provides a general-purpose, serverless container platform.
Hello Sharma, Ritika,
To get your AzUrlShortener Container App talking to a Storage Account over private endpoints with public access off, you’ll need to bake the VNet integration into your Container App Environment at deployment time. You can’t retrofit a completely new VNet into an existing environment via the portal alone. Here’s what you should do:
- Use a workload-profiles Container App Environment • Consumption-only environments don’t support VNet integration – make sure you’re on a “Workload profiles” (dedicated) plan.
- Update your Bicep template on the
Microsoft.App/managedEnvironmentsresource to includevnetConfigurationand disable public access:
resource env 'Microsoft.App/managedEnvironments@2023-06-01' = {
name: envName
location: location
properties: {
// Disable public network access so only your VNet + private endpoints can talk to this env
publicNetworkAccess: 'Disabled'
// VNet integration settings
vnetConfiguration: {
infrastructureSubnetId: resourceId('MyRg','Microsoft.Network/virtualNetworks/subnets','myVnet','infrastructure-subnet')
appSubnetIds: [
resourceId('MyRg','Microsoft.Network/virtualNetworks/subnets','myVnet','app-subnet')
]
}
// Optional: internal load balancer if you want fully internal ingress
internalLoadBalancer: {
enabled: true
}
}
}
- Deploy that updated Bicep. This creates an environment that’s already wired into your VNet subnets.
- In the same or a follow-up Bicep/CLI/template, deploy your container app into that environment.
- Configure the Storage Account with a private endpoint in the same VNet, disable its public access, and ensure your VNet’s private DNS zone is resolving the storage account FQDN.
After doing the above, your AzUrlShortener app will be able to reach the storage account over the private link, and nothing externally will be exposed.
Follow-ups if you hit any snags: • Are you already on a workload-profiles environment or on consumption-only? • Can you share your current Bicep snippet for the managedEnvironment resource? • How have you set up your subnets / NSG – do you have the required allow-list for Azure platform traffic? • Have you configured the private DNS zone and linked it to your VNet so that the storage account’s privatelink zone resolves?
Reference list • Provide a virtual network to an Azure Container Apps environment (Bicep) – https://aka.ms/container-apps-vnet-custom-bicep
• How to use private endpoints with Container Apps – https://aka.ms/container-apps-private-endpoint
• Securing a custom VNet in Azure Container Apps – https://aka.ms/container-apps-firewall-integration
• Integrate your App Service with a VNet (Windows Containers guidance) – https://aka.ms/appservice-vnet-integration
Networking in Azure Container Apps environment
Networking in Azure Container Apps environment
Please accept as answer and do a Thumbs-up to upvote this response if you are satisfied with the community help. Your upvote will be beneficial for the community users facing similar issues.