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:

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