Hi @martin ,
Thanks for contacting Microsoft Q&A platform.
My approach to solve this would be to use init containers.
Any container group can have up to 59 init container that act the same as k8s init containers
Once in the init container, you can pull the updated container instance private ip:
ipAddress=$(az container show --resource-group "MyResourceGroup" --name "MyContainer" -o json --query ipAddress.ip)
Then update the application gateway backend pool ip:
az network application-gateway address-pool update -g MyResourceGroup --gateway-name MyAppGateway -n MyAddressPool --servers $ipAddress
Note: every init container must exit successfully beforeyour application begins, so make sure you have a restart policy for the init containers in case it fails.
Note 2: To give the container instance correct permissions in your Azure portal you can use managed identity and IAM.
Note 3: A container with Azure cli: mcr.microsoft.com/azure-cli
Here is a reference on init containers
Hope this helps you.