Azure Function app with Azure Container Registry not configurable via portal

JANKULOSKI Dame -C I O 5 Reputation points
2023-01-20T14:23:57.6466667+00:00

I tried to deploy an Azure Function app that is supposed to run from a custom container registry which is hosted in Azure Container Registry in the same resource group as the Azure Function app. During the Template deployment I couldn't select Azure Container Registry for the source, and it forced it to Private Registry.

Once deployed, I'm able to toggle the option to Azure Container Registry and provide all other necessary settings, however, the Save button in the Deployment Center is grayed out.

User's image

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,122 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Santhi Swaroop Naik Bukke 595 Reputation points
    2023-01-20T17:42:10.38+00:00

    Azure Function apps can be configured to use an Azure Container Registry (ACR) to pull and run container images. However, configuring this via the Azure portal can be a bit tricky as it requires some additional setup steps.

    Here are the general steps to configure an Azure Function app to use an ACR:

    1. Create an Azure Container Registry (ACR) in your Azure subscription
    2. Create an Azure Function App and configure it to use a Docker container
    3. In the Azure Function App's Configuration, add an app setting for WEBSITES_ENABLE_APP_SERVICE_STORAGE with a value of true
    4. Create an Azure Function App's identity and give it the AcrPull role to the ACR, this can be done through Azure CLI or Azure portal
    5. In the Azure Function App's Configuration, add an app setting for WEBSITES_PORT with the value of the exposed port of your container, this is usually 80.
    6. In the Azure Function App's Configuration, add an app setting for WEBSITES_REGISTRY_SERVER_URL with the value of the ACR login server, for example, https://<your_registry_name>.azurecr.io
    7. In the Azure Function App's Configuration, add an app setting for WEBSITES_REGISTRY_SERVER_USERNAME with the value of the ACR username.
    8. In the Azure Function App's Configuration, add an app setting for WEBSITES_REGISTRY_SERVER_PASSWORD with the value of the ACR password.
    9. Finally, in the Azure Function App's Configuration, add an app setting for WEBSITES_REGISTRY_NAME with the value of the ACR name.

    Once you have completed these steps, your Azure Function App should be able to pull and run container images from the ACR.

    It's important to note that these steps are not configurable via the Azure portal, you need to use Azure CLI, PowerShell or Azure Rest API to configure these values.

    It's also important to keep in mind that running containers in Azure Function App comes with some limitations, you should check the official documentation for more information.

    1 person found this answer helpful.
    0 comments No comments

  2. JANKULOSKI Dame -C I O 5 Reputation points
    2023-01-23T13:13:58.4333333+00:00

    The issue was caused by the credentials for Function App's System Assigned MI not being properly retrieved during the Azure Resource deployment. I'm using DevOps pipeline and bicep templates to deploy the private container registry and function app. During this process the System Assigned Managed Identity is created for the function app and given the AcrPull role within the container registry. However, this doesn't seem to work fully and I had to toggle one of the settings in the Deployment Center so that the Save button can be initiated.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.