I have an Azure Container Instance with subnet configuration (I need to access an internal service). But I also need to configure dns. I try to create the Container, but it returns this message: The IP address type can not be public when the network profile is set. Is it possible to configure dns and configure the subnet in the same container?
2 Answers
Unfortunately, if you deploy the Azure Container Instances in the Subnet of a Vnet, then you cannot set the public IPs or DNS for it. Azure does not support it, at least now. Maybe it will be supported in the future. For more details, see Virtual network deployment limitations.
Container groups deployed to a virtual network do not currently support public IP addresses or DNS name labels.
Hope this will help you.
The error with the network profile looks like a bug in the az command tool. If you just specify your VNET name and subnet name then it will create a network profile name.
If you want to use DNS to resolve these names you'll need to setup DNS separately, and call an additional
azcommand to configure the DNS after you create the container instance.az network dns record-set a add-record ...
See this doc for using Azure DNS with private IP addresses.