You are deploying a containerized Azure Function App using a custom Linux Docker image stored in a private Azure Container Registry (ACR).
You must configure the Function App to pull the container image from the ACR using a system-assigned managed identity instead of admin credentials.
Which five actions should you perform in sequence? To answer, arrange the actions in the correct order.
- 1Build the Function App container image and push it to the Azure Container Registry (ACR).
- 2Create a Linux-based Function App in an Elastic Premium plan configured for custom containers.
- 3Enable the system-assigned managed identity for the Function App.
- 4Assign the AcrPull role to the Function App's system-assigned managed identity at the ACR resource scope.
- 5Add an application setting named ACR_USE_MANAGED_IDENTITY_CREDENTIALS to the Function App and set its value to true.
Answer
The correct order of actions is: 1) Build and push the container image to the Azure Container Registry; 2) Create the Linux-based Function App in a plan that supports containers; 3) Enable the system-assigned managed identity on the Function App; 4) Assign the AcrPull role to the managed identity at the registry scope; 5) Configure the ACR_USE_MANAGED_IDENTITY_CREDENTIALS application setting to true.
To secure the deployment of a custom container image from a private Azure Container Registry (ACR) to an Azure Function App, you must first build and push the container image to ACR. Next, create the Function App on an Elastic Premium or Dedicated hosting plan, as Consumption plans do not support custom container deployments. Once the app is created, enable the system-assigned managed identity. With the identity active, you can then assign it the 'AcrPull' role at the registry scope. Finally, configure the Function App settings to use the managed identity credentials by setting the ACR_USE_MANAGED_IDENTITY_CREDENTIALS app setting to true.
Step-by-Step Solution
Key Concept
Deploying containerized Azure Functions using managed identity for Azure Container Registry authentication