I am new to azure functions.I have written in python I am using blob Trigger but it gets stuck at Host lock lease acquired by instance ID '000000000000000000000000055662B6'. some forums say init.py is needed some say its not. here is what my folder structure looks like. Its boiler plate code
1 Answer
To run your code, make sure you have added valid Storage connection string to the environment variable AzureWebJobsStorage in local.settings.json.
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "<Storage_Connection_String>",
"FUNCTIONS_WORKER_RUNTIME": "python",
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing"
}
}
Create a Container named upload144 and upload the .csv file the folder new.


Able to run the function and got the expected output:
function_app.py:
app = func.FunctionApp()
@app.blob_trigger(arg_name="myblob", path="upload144/new/{name}.csv",
connection="AzureWebJobsStorage")
def BlobTrigger(myblob: func.InputStream):
logging.info(f"Python blob trigger function processed blob"
f"Name: {myblob.name}"
f"Blob Size: {myblob.length} bytes")
Output:
Found Python version 3.11.9 (py).
Azure Functions Core Tools
Core Tools Version: 4.0.6821 Commit hash: N/A +c09a2033faa7ecf51b3773308283af0ca9a99f83 (64-bit)
Function Runtime Version: 4.1036.1.23224
[2025-04-14T04:49:25.202Z] Worker process started and initialized.
Functions:
BlobTrigger: blobTrigger
For detailed output, run func with --verbose flag.
[2025-04-14T04:49:31.570Z] Host lock lease acquired by instance ID '000000000000000000000000F72731CC'.
[2025-04-14T04:49:34.758Z] Executing 'Functions.BlobTrigger' (Reason='New blob detected(LogsAndContainerScan): upload144/new/Hello World.csv', Id=76719c6e-cd5c-4b75-8236-ef4b99b6a892)
[2025-04-14T04:49:34.763Z] Trigger Details: MessageId: 70acb2ed-b30e-4c5a-ab40-d171f73ba0dd, DequeueCount: 1, InsertedOn: 2025-04-14T04:49:31.000+00:00, BlobCreated: 2025-04-14T04:48:52.000+00:00, BlobLastModified: 2025-04-14T04:48:52.000+00:00
[2025-04-14T04:49:34.816Z] Python blob trigger function processed blobName: upload144/new/Hello World.csvBlob Size: None bytes
[2025-04-14T04:49:34.838Z] Executed 'Functions.BlobTrigger' (Succeeded, Id=76719c6e-cd5c-4b75-8236-ef4b99b6a892, Duration=1166ms)
local.settings.jsonin text format and @academy_courses2021.