I have created a blob trigger function app with python.
I also have a blob storage in my storage account.
The settings (local.settings, function.json) seems ok.
After running : func start and uploading a file in the blob nothing is happening.
this is the code:
import logging
from azure.functions import InputStream
import pandas as pd
import datetime
from datetime import datetime as dt
from datetime import date,timedelta
import datetime
from dateutil.relativedelta import relativedelta
import numpy as np
import os
import azure.storage.blob
from azure.identity import DefaultAzureCredential
from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient
import azure.functions as func
default_credential = DefaultAzureCredential()
def main(myblob: func.InputStream):
logging.info(f"Python blob trigger function processed blob n"
f"Name: {myblob.name}n"
f"Blob Size: {myblob.length} bytes")
try:
# Process the blob data here
data = myblob.read()
logging.info(f"Blob content: {data}")
except Exception as e:
logging.error(f"Error processing blob: {str(e)}")
I just wanna see the loggings are working after uploading a new file.
I also receive no error after func run.
Can you please guide me how to overcome this?
I can read/write the blob with my notebook but the function app is not working.
Hossein Chegini is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.