I have a simple problem. I need to configure my App Service to be able to connect to on-premies Artifactory.
In App Service, I set up Deployment Center as a screenshot (URL and the image name are changed)
Additionally, I enabled VNet Integration to VNet which has access to on-premies env.
For example, VMs in the same subnet can pull a docker image from Artifactory but App Service can’t.
Below log with the error.
023-08-07T07:35:20.683Z INFO - Attempting to pull image *URL_ARTIFACTORY_ONPREMIES/IMAGE_NAME*:latest from VNET. 2023-08-07T07:35:52.219Z ERROR - Image pull for *URL_ARTIFACTORY_ONPREMIES/IMAGE_NAME*:latest failed. UnexpectedFaliure 2023-08-07T07:35:52.221Z ERROR - Pulling docker image *URL_ARTIFACTORY_ONPREMIES/IMAGE_NAME*:latest over VNET failed. 2023-08-07T07:35:52.222Z WARN - Image pull failed. Defaulting to local copy if present. 2023-08-07T07:35:52.906Z ERROR - Image pull failed: Verify docker image configuration and credentials (if using private repository)
I set up WEBSITE_PULL_IMAGE_OVER_VNET to True.
My question is: by default App Service try to connect by public ip addresses? (Outbound Traffic)
Please any hints or advice. Thanks.
2
Answers
Azure App Service instance initiates outbound requests, it uses public IP addresses assigned to the Azure region’s outbound network infrastructure.
Use the below format template upon selecting private registry:
You enabled VNet Integration and set the
WEBSITE_PULL_IMAGE_OVER_VNET
app setting toTrue
so by default Azure App Service uses public IP addresses for outbound traffic.App Service will try to pull the image over the VNet. However, clear it from your end that whether the Artifactory is accessible through the VNet.
Check that you have selected network security groups as above and also in app service go to settings<Identity<System assigned should be "on."
Yes, I think App Service by default tries to go through public network. You can go to the App Service Kudu debug console from App Service -> Development Tools -> Advanced Tools and try the command
nslookup repositoryurlorendpoint
if you are deploying to a Linux App Service.In our case this error (‘UnexpectedFaliure’) happened because it resolved to a public IP inside the App Service (as seen from Kudu), not a virtual network one (for example 10.x.x.x). I.e. the DNS settings were not correct (required custom DNS servers, not Default (Azure-provided) in vnet settings)