ACR Images are not listing while creating Azure function as Docker.
I first created pushed my docker to ACR and then I tried to create azure function as a docker on same location and resource group but it is not listing my ACR image, I tried several times. Please let me know the issue and how can I fix it.
Azure Container Instances
Azure Functions
-
RevelinoB • 3,440 Reputation points
2023-04-30T08:45:47.09+00:00 Hi Bharat,
If you encounter the issue of not being able to see your Azure Container Registry (ACR) images while creating an Azure Function as a Docker container, there are several potential causes you can troubleshoot this issue with the following steps.
- Confirm the ACR Access: Ensure that you have the appropriate permissions to access the Azure Container Registry. Check that you possess the correct Azure Active Directory (AAD) credentials and roles to access the registry. Make sure your user or service principal has the "AcrPull" role assigned.
- Check the ACR Region: Confirm that both your Azure Function and Azure Container Registry are located in the same Azure region. If they reside in different regions, the Azure Function may not have the necessary access to the ACR images.
Check ACR Visibility: Double-check the visibility settings of your ACR. By default, ACR images are private and accessible only to authorized users. You can make your images public or grant access to specific users or service principals. Verify that your ACR's access control settings are properly configured.
- Cross check the ACR Image Tags: Ensure that you have tagged and pushed the Docker image correctly to your ACR. Use the appropriate naming convention for the image, including the fully qualified ACR login server name and tag. For example,
myacr.azurecr.io/myimage:latest
. - Check the ACR Image Listing: Validate the contents of your ACR repository using the Azure portal or command-line tools such as the Azure CLI or Docker CLI. Confirm that the expected image is present in the ACR repository and has the intended tag.
- Refresh Azure Function Configuration: If you have recently pushed an image to the ACR, try refreshing the Azure Function configuration page or the Azure portal itself. Occasionally, it may take a short while for the portal to reflect the most recent changes.
I hope this helps?
-
Bharat Singla • 0 Reputation points
2023-05-01T17:56:49.7633333+00:00 Thank you for your answer, I confirm that I have the right access, and in the same region with correct image tag. Although, I am able to access ACR image using app service but not through azure function.
-
RevelinoB • 3,440 Reputation points
2023-05-01T18:00:50.1666667+00:00 Hi Bharat,
If you are able to access the ACR image through an App Service but not through an Azure Function, it could indicate a potential configuration issue specific to the Azure Function. Here are some checks you can take to troubleshoot and resolve the problem:
Verify the runtime and image compatibility: Ensure that the Azure Function runtime and the ACR image are compatible. Azure Functions supports multiple runtime versions, such as Node.js, .NET, Python, and Java. Check that the runtime version specified in your Azure Function is compatible with the image you are trying to use.
Check the Azure Function configuration: Review the configuration settings of your Azure Function. Verify that the container settings are correctly configured to use the ACR image. Ensure that you have specified the correct image name, tag, and repository in the function's configuration.
Validate the function's deployment: Check if the Azure Function deployment process completed successfully. You can examine the deployment logs to identify any errors or issues that may have occurred during the deployment. Review the deployment logs in the Azure portal or retrieve them using the Azure CLI or Azure PowerShell commands.
Test locally with Azure Functions Core Tools: Use the Azure Functions Core Tools to test running your Azure Function locally using the ACR image. This can help identify if the issue is specific to the Azure portal or if there are any configuration or code-related issues in your Azure Function itself.
Examine function logs and diagnostics: Enable diagnostic logging for your Azure Function and examine the logs for any error messages or exceptions related to the container or ACR image. This can provide more insight into the specific issue and help narrow down the problem.
Try redeploying the function: If all else fails, try redeploying the Azure Function from scratch, ensuring that you follow the correct steps to configure the container settings and specify the ACR image. Sometimes, a fresh deployment can resolve configuration issues that may have occurred during the initial setup.
If you're still experiencing difficulties, it may be helpful to provide more specific details about the error messages, logs, and any additional configuration or code you are using. This will allow for a more accurate diagnosis and targeted troubleshooting.
I hope this helps?
-
vipullag-MSFT • 26,431 Reputation points
2023-05-05T03:23:46.3766667+00:00 Hello Bharat Singla
Any update on the issue?
Just checking in to see if you got a chance to see previous response. Please let us know if this helped solve your issue.
-
Asif Gohar • 0 Reputation points
2023-08-03T17:51:32.3366667+00:00 I have the same issue, checked all the suggestions but it will simply doesn’t list. I compared with the one that is being listed and both has exactly same settings.
Sign in to comment