After deployment Azure function (blob-trigger) is not invoked after a blob is uploaded to the blob storage

Maryna Paluyanava 191 Reputation points
2024-04-25T17:50:58.4966667+00:00

Hello,

After deployment Azure function (blob-trigger) is not invoked after a blob is uploaded to the blob storage. Locally it works correctly.

What could be the reason?

Thank you!

import azure.functions as func
import logging
import pandas as pd

app = func.FunctionApp()

@app.blob_trigger(arg_name="inputblob", path="data/input/{filename}.csv",
                               connection="ConnectionString")
@app.blob_output(arg_name="outputblob",
                path="data/output/{filename}.csv",
                connection="ConnectionString")
def BlobTrigger(inputblob: func.InputStream, outputblob: func.Out[str]):
    logging.info(f"Python blob trigger function processed blob"
                f"Name: {inputblob.name}"
                f"Blob Size: {inputblob.length} bytes")

    df_input = read_input_blob_as_df(inputblob)

    write_df_to_blob(df_input, outputblob)


host.json

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  },
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[4.*, 5.0.0)"
  }
}

local.setings.json


{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "<BLOB STORAGE CONNECTION STRING>",
    "FUNCTIONS_WORKER_RUNTIME": "python",
    "AzureWebJobsFeatureFlags": "EnableWorkerIndexing",
    "ConnectionString": "<BLOB STORAGE CONNECTION STRING>"
  }
}
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,300 questions
0 comments No comments
{count} votes

Accepted answer
  1. SwathiDhanwada-MSFT 17,641 Reputation points
    2024-04-28T12:36:36.8+00:00

    @Maryna Paluyanava The local.settings.json is only intended to be used when developing on your local machine (stage or prod environment should be configured in Azure Functions' app settings). The settings in the local.settings.json file in your project should be the same as the application settings in the function app in Azure. Any settings you add to local.settings.json you must also add to the function app in Azure. These settings aren't uploaded automatically when you publish the project.

    Once you have deployed your code, you will be prompted to upload your setting. If you haven't done it, kindly upload it by following the steps mentioned in this document.

    12126-capture.jpg

    0 comments No comments

0 additional answers

Sort by: Most helpful