Hi @jim01011 Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here.
The blob name is available in the Azure blob trigger function V2 within the def main(myblob: func.InputStream)
method and can be accessed outside of the logging.info as well.
Looking at the method signatures in your function, you are trying to perform some operations on the newly added blob and trying to use the input binding through the @app.blob_input(arg_name="inputblob", path="input/{name}"
function. Instead of this, you can create a blob_clinet under the method def main(myblob: func.InputStream)
and perform operations or access blob data as follows
def lsayanablob_trigger(myblob: func.InputStream):
#feed the above URL to fromURL in analyze_layout()
#Include code from Document intelligent SDK
logging.info(f"Python blob trigger function processed blob"
f"Name: {myblob.name}"
f"Blob Size: {myblob.length} bytes")
#assign to variable
blob_name = myblob.name.split("/")[-1]
container_name = myblob.name.split("/")[0]
#create a blob service client
newblob_client = blob_service_client.get_blob_client(container=container_name, blob=blob_name)
logging.info(f"Printing the copied blob name {blob_name}")
#extract the blob properties
logging.info(f"logging blob properties {newblob_client.get_blob_properties()}")
Please note that the name
filed accessed through myblob.name contains the path to the container and the name of the file. We can split that and extract the container name as well as file name to create the blob service client.
With the created blob_service_client
you can access all the methods outlined in the BlobClient class and perform various operations.
Hope this helps! If you need additional assistance with accessing the uploaded blob content, kindly share additional details of your use case so we can assist you further.
If the response helped, please do click Accept Answer and Yes for the answer provided. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.