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:
- Create an Azure Container Registry (ACR) in your Azure subscription
- Create an Azure Function App and configure it to use a Docker container
- In the Azure Function App's Configuration, add an app setting for
WEBSITES_ENABLE_APP_SERVICE_STORAGEwith a value oftrue - Create an Azure Function App's identity and give it the
AcrPullrole to the ACR, this can be done through Azure CLI or Azure portal - In the Azure Function App's Configuration, add an app setting for
WEBSITES_PORTwith the value of the exposed port of your container, this is usually 80. - In the Azure Function App's Configuration, add an app setting for
WEBSITES_REGISTRY_SERVER_URLwith the value of the ACR login server, for example,https://<your_registry_name>.azurecr.io - In the Azure Function App's Configuration, add an app setting for
WEBSITES_REGISTRY_SERVER_USERNAMEwith the value of the ACR username. - In the Azure Function App's Configuration, add an app setting for
WEBSITES_REGISTRY_SERVER_PASSWORDwith the value of the ACR password. - Finally, in the Azure Function App's Configuration, add an app setting for
WEBSITES_REGISTRY_NAMEwith 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.