@Retention(value=RUNTIME) @Target(value=PARAMETER) public @interface BlobTrigger
Place this on a parameter whose value would come from a blob, and causing the method to run when a blob is uploaded. The parameter type can be one of the following:
The following example shows a Java function that logs the filename and size when a blob is added or updated in the "samples-workitems" container:
@FunctionName("blobMonitor")
public void blobMonitor(
@BlobTrigger(name = "file",
dataType = "binary",
path = "samples-workitems/{name}",
connection = "AzureWebJobsStorage") byte[] content,
@BindingName("name") String filename,
final ExecutionContext context
) {
context.getLogger().info("Name: " + filename + ", Size: " + content.length + " bytes");
}BindingName| Modifier and Type | Required Element and Description |
|---|---|
String |
name
The variable name used in function.json.
|
String |
path
Defines the path of the blob to which to bind.
|
| Modifier and Type | Optional Element and Description |
|---|---|
String |
connection
Defines the app setting name that contains the Azure Storage connection string.
|
String |
dataType
Defines how Functions runtime should treat the parameter value.
|
String |
source
Defines the parameter to specify the type of the blob trigger to use, example EventGrid for event grid blob trigger.
|
public abstract String name
public abstract String path
public abstract String dataType
Defines how Functions runtime should treat the parameter value. Possible values are:
public abstract String connection
public abstract String source
Copyright © 2022. All rights reserved.