Azure Function are not loaded at runtime after deployment.

AJAY KUMAR 1 Reputation point
2023-05-04T17:13:09.2566667+00:00

Problem : Function are not loaded at runtime after deployment.

Deployment method: We are using terraform automation for creating azure function resource in azure. Than we build docker container using dockerfile and push it to Azure container registry and Azure function is set to pulls this image through Vnet and run the container using User Assigned Managed Identity.

Configuration : We are using .net7 Isolated runtime Linux azure function.  Expected settings dotnet_version:7.0 and use_dotnet_isolated_runtime:true  

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
461 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,084 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,166 questions
{count} votes

2 answers

Sort by: Most helpful
  1. VasimTamboli 5,075 Reputation points
    2023-05-06T18:40:54.4166667+00:00

    There could be several reasons why your Azure Function is not loading at runtime after deployment. Here are a few things you can check to troubleshoot the issue:

    Check that the Azure Function is deployed to the correct resource group and region in Azure. Ensure that the function app is started and running.

    Verify that the correct Docker image is being pulled by the Azure Function at runtime. You can check the logs of the Azure Function for any errors related to Docker image or runtime.

    Ensure that the User Assigned Managed Identity has the necessary permissions to access the Azure Container Registry and pull the Docker image.

    Check that the Terraform automation script is correctly configured to deploy the Azure Function resource and all its dependencies.

    Make sure that the Dockerfile is correctly configured to build the Docker image for the Azure Function, and that all necessary files and dependencies are included in the image.

    Verify that the .NET 7 Isolated runtime is installed and configured correctly on the Azure Function. Check the logs for any errors related to the runtime.

    Ensure that the Azure Function is configured correctly to run in a VNet, and that the VNet and associated resources are correctly configured and deployed.

    If none of the above steps resolve the issue, it may be helpful to review the detailed logs and error messages generated by the Azure Function to determine the root cause of the problem

    0 comments No comments

  2. Ryan Hill 28,631 Reputation points Microsoft Employee
    2023-05-18T02:46:02.92+00:00

    Hi @AJAY KUMAR

    I'm glad to see you were able to resolve your issue. Thanks for posting your solution so that others experiencing the same thing can easily reference this.

    Since the Microsoft Q&A community has a policy that the question author cannot accept their own answer, they can only accept answers by others, I'll repost your solution in case you'd like to Accept the answer.

    Issue: You're using Terraform to create Azure Function instance which then pulls your app code from a container registry. After image pull, the function app failed to load.

    Resolve: You set WEBSITES_ENABLE_APP_SERVICE_STORAGE application setting to false.


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.