Brief Summary:
Functions App deployed via Docker Image on Azure Container Registry do not appear when linking a custom allocation function to a Device Provisioning Service Enrollment Group. This does not happen when Functions App is deployed via code on the portal or .zip (view Figure 1).
Details:
I have deployed a Device Provisioning Service on which I have defined an enrollment group. For provisioning the devices, I have defined a Custom Allocation Function. The custom allocation function is deployed to a docker image in Azure container registry. When I run the pcs-cli program for deploying the Azure services everything works fine (the custom allocation function is linked to the enrollment group and devices are provisioned by using that function (see Figure 2)).
However, if I try to manually link the function to the enrollment group (in the Azure Portal) it does not appear (see Figure 3).
Workaround
I can manage to link the function again to the enrollment group via azure cli with the following command:
----------
az iot dps enrollment-group update -g $SOLUTION_NAME --dps-name $DPS_NAME --enrollment-id $ENROLLMENT_ID --iot-hubs $IOT_HUB_HOST --allocation-policy custom --webhook-url $ALLOCATION_FUNCTION --api-version 2019-03-31 --certificate-path ./certs/intermediate.cert.pem --initial-twin-tags "$TWIN_TAGS" --initial-twin-properties "$TWIN_PROPERTIES"
----------
Additional tests
I have been deploying both types of functions (docker image based and zip code based) several times via ARM templates and finally I have noticed that the only changing code line in the ARM template is the one that states:
"linuxFxVersion": "DOCKER|registry.azurecr.io/platformazurefunctions:testing" in docker image based deployment and
"linuxFxVersion": "DOTNET|3.1" on code based deployment.