0

I have an Event Grid Trigger Azure function created using VS Code. Here's how my function JSON looks like:

{
  "scriptFile": "__init__.py",
  "bindings": [
    {
      "name": "myblob",
      "type": "blobTrigger",
      "direction": "in",
      "path": "input/{name}",
      "source": "EventGrid",
      "connection": "AzureWebJobsStorage"
    }
  ]
}

Here's my init file:

def main(myblob: func.InputStream):
    logging.info(f'File: {myblob.name}')

When I drop a file in this path, it won't trigger the log for some reason. Even though my connection string for the Azure storage is in my local settings. What am I doing wrong?

razer
  • 21
  • 4

1 Answers1

1

I have reproduced an event grid trigger in my environment and got expected results and I followed below process.

One of the ways to create event grid trigger function is to create it using Azure portal. Firstly, created a python Event grid trigger function as below:

enter image description here

Then I created a Storage Account and Created a Event Grid as below:

enter image description here

Then selected the events what I want to be triggered as below:

enter image description here

Then select azure function and the select an endpoint as below:

enter image description here

Now to test, I have uploaded a blob in my storage account container as below:

enter image description here

Now when I check my logs of Event Grid Function app I find that the event is triggered as below:

enter image description here

Try to do this way, you will get Triggered as mine got.

RithwikBojja
  • 5,069
  • 2
  • 3
  • 7