Azure Function Invocations not appearing

Brian 20 Reputation points
2025-04-14T14:05:49.3666667+00:00

Hi,

I created a simple hello-world-style Azure function with a HTTP trigger.

In the portal, function metrics show the invocations (Function app > Overview > Metrics).

However, no invocations are shown under Function app > Overview Functions > http_test > Invocations.

The following information may be helpful:

This is the host.json:

{
  "version": "2.0",
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[4.*, 5.0.0)"
  }
}

This is the function_app.py:

import azure.functions as func
import logging

app = func.FunctionApp()


@app.route(auth_level=func.AuthLevel.ANONYMOUS, methods=[func.HttpMethod.GET])
def http_test(req: func.HttpRequest) -> func.HttpResponse:
    logging.info("Python HTTP trigger function processed a request.")
    return func.HttpResponse(
        "This HTTP triggered function executed successfully.", status_code=200
    )

I use an Azure Pipeline for deployment:

trigger:
  - main

variables:
  targetResourceName: "*censored*"
  azureServiceConnectionName: "*censored*"
  agent: "ubuntu-latest"
  projectRoot: $(System.DefaultWorkingDirectory)
  environmentName: "none"
  pythonVersion: "3.11"

pool:
  vmImage: ubuntu-latest

steps:
  - task: UsePythonVersion@0
    displayName: "Set Python version to 3.11"
    inputs:
      versionSpec: "3.11"
      architecture: "x64"
  - task: Bash@3
    displayName: "Install pip requirements"
    inputs:
      targetType: "inline"
      script: |
        python -m pip install --upgrade pip
        pip install --target="./.python_packages/lib/site-packages" -r ./requirements.txt
      workingDirectory: "$(Build.SourcesDirectory)"
  - task: ArchiveFiles@2
    displayName: Zip
    inputs:
      rootFolderOrFile: "$(Build.SourcesDirectory)"
      includeRootFolder: false
      archiveType: "zip"
      archiveFile: "$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip"
      replaceExistingArchive: true
  - task: AzureFunctionApp@2
    inputs:
      azureSubscription: $(azureServiceConnectionName)
      appType: functionAppLinux
      appName: $(targetResourceName)
      package: "$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip"
      deploymentMethod: runFromPackage

The environment variables are:

User's image

I can then invoke the function using https://censored.azurewebsites.net/api/http_test

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

Answer accepted by question author
  1. Anonymous
    2025-04-17T06:22:48.47+00:00

    Hello Brian,

    Thank you for your patience and for sharing your feedback on the Q&A community platform. I’m glad to hear that you were able to resolve your issue, and I appreciate you sharing your solution! Your contribution is valuable and can help others in the community facing similar challenges.

    As per the Microsoft Q&A community policy, "The question author cannot accept their own answer. They can only accept answers by others"

    I’m reposting your solution here so you can mark it as accepted if it resolves your query:

    "The problem was caused by the VNet configuration, which was blocking traffic from the Function App to the Application Insights instance".

    Thank you again for your time and patience throughout this issue. 

    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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