简体   繁体   中英

Azure Function Blob Storage Trigger is not triggering

I tested the blob storage trigger in my local in vs code. I'm using python and it is working but when I pushed the code to Azure and tried to store the file but nothing showing in the log. I waited for like 15-30 mins and still nothing. How do I know it is running or not? Please help!

As Bowman said, maybe the problem is the storage connections in local.settings.json, you should navigate to configuration under settings to check the app settings with a storage connection string value like the picture below.

在此处输入图像描述

And if you want to see the details in logs, you can go to KUDU unless you use Consumption plan , because Advanced Tools (Kudu) is currently not supported for Linux Consumption plans. 在此处输入图像描述

Another way is adding an output binding , like creating a new blob after triggering. If your function run successfully, there should be a new blob in your container. If the new blob is not created, you can check your code or anything wrong else.

import logging
import azure.functions as func


def main(queuemsg: func.QueueMessage, inputblob: func.InputStream,
         outputblob: func.Out[func.InputStream]):
    logging.info('Python Queue trigger function processed %s', inputblob.name)
    outputblob.set(inputblob)

Refer to the docs to add output binding if you need: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-output?tabs=python

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM