I developed an Azure Function App using Python 3.9 around 2 to 3 years ago and deployed it using Visual Studio Code. The app consists of 3 functions: 2 blob triggers and 1 HTTP trigger. Initially, it was working fine, getting triggered whenever a file was uploaded to the specified container.
Recently, I needed to make some changes to the functions. While checking the functions, I found that in the monitor section of my function app, there were no logs for the last 30 days, even though new files had been entered into the specified container. Additionally, there were no logs for the HTTP triggered function. Upon further investigation, I realized that the function app has not been triggered for a few months. I haven't made any changes since the initial development. (My function app and storage account are in different resource groups.)
NTo fulfill my requirement, I created a new function app and deployed it with the old source code in the v1 format from my local machine using Visual Studio Code. However, while doing this, I encountered some errors.
Initially, after creating the function app and deploying it for the first time, the deployment was successful. However, upon uploading a file to the specified container, the function didn't get triggered.
Upon attempting a second deployment, I encountered the following error

in log stream of function app i am getting this logs

I have checked the connection string, which is specified correctly while deployment as application setting.
My host.json:
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[2.*, 3.0.0)"
}
}
Settings.json
{
"azureFunctions.deploySubpath": ".",
"azureFunctions.scmDoBuildDuringDeployment": true,
"azureFunctions.pythonVenv": ".venv",
"azureFunctions.projectLanguage": "Python",
"azureFunctions.projectRuntime": "~4",
"debug.internalConsoleOptions": "neverOpen"
}
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "func",
"command": "host start",
"problemMatcher": "$func-python-watch",
"isBackground": true,
"dependsOn": "pip install (functions)"
},
{
"label": "pip install (functions)",
"type": "shell",
"osx": {
"command": "${config:azureFunctions.pythonVenv}/bin/python -m pip install -r requirements.txt"
},
"windows": {
"command": "${config:azureFunctions.pythonVenv}\\Scripts\\python -m pip install -r requirements.txt"
},
"linux": {
"command": "${config:azureFunctions.pythonVenv}/bin/python -m pip install -r requirements.txt"
},
"problemMatcher": []
}
]
}
Launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Python Functions",
"type": "python",
"request": "attach",
"port": 9091,
"preLaunchTask": "func: host start"
}
]
}
extensions.json
{
"recommendations": [
"ms-azuretools.vscode-azurefunctions",
"ms-python.python"
]
}
I attempted redeployment with the old function app, but encountered a different Oryx error. Consequently, I tried with another function app. My goal is to successfully deploy the function app and ensure that the blob trigger functions are activated upon file uploads.
You need to use latest Extension version in
host.jsonfile which is[4.*, 5.0.)This worked for me:
I am using a sample blob trigger
#My Code :
__init__.py:function.json:launch.json:host.json:OUTPUT:# Locally :
# Azure :