-
Notifications
You must be signed in to change notification settings - Fork 9
/
TriggerPojo.java
37 lines (32 loc) · 1.14 KB
/
TriggerPojo.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.danielrocks.function.blob.trigger;
import com.danielrocks.function.common.ToDoItem;
import com.microsoft.azure.functions.ExecutionContext;
import com.microsoft.azure.functions.annotation.BindingName;
import com.microsoft.azure.functions.annotation.BlobTrigger;
import com.microsoft.azure.functions.annotation.FunctionName;
/**
* Azure Functions with Blob Storage Trigger.
*
* The following example shows a Java function that uses the BlobTrigger
* annotation to be notified of changes to a certain storage container.
*
* https://github.com/Azure/azure-functions-java-worker/issues/256
*
*/
public class TriggerPojo {
@FunctionName("blobprocessorPojo")
public void run(
@BlobTrigger(
name = "file",
dataType = "",
path = "samples-workitems/{name}",
connection = "Storage_Account_Connection_String")
ToDoItem content,
@BindingName("name") String filename,
final ExecutionContext context) {
// log
context.getLogger().info("Name: " + filename);
// do something with blob
context.getLogger().info("ToDoItem is: " + content.getId() + " - " + content.getDescription());
}
}