Reading the metadata (blob and container name) from azure functions using python, but during processing it says NoneType

Below is the code,

import logging import json, os import azure.functions as func import twilio import twilio.rest from twilio.rest import Client def main(myblob: func.InputStream):     filename = logging.info(f"Python blob trigger function processed blob \n"                  #f"Name: {myblob.name}\n"                  #f"Blob Size: {myblob.length} bytes")     filename = logging.info(myblob.name)     print(filename)     #output - teamaudio/22108192-9a74-4b6e-a237.wav     fname = filename.split("/")[1]     print(fname)     client = Client(account_sid,auth_token) 

Error

 none type object has not attribute split   

Expected output:

 22108192-9a74-4b6e-a237.wav 

Please guide on how to fix this issue..

Add Comment
1 Answer(s)

logging.info returns None:

>>> import logging >>> s = logging.info('test') >>> type(s) <class 'NoneType'> 

so the error is expected.

You want to use:

fname = myblob.name.split("/")[1] 
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.