Skip to content

Commit a429b01

Browse files
authored
add input binding example and add missing zone end
1 parent f1464b6 commit a429b01

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

articles/azure-functions/functions-bindings-storage-blob-trigger.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ public void run(
617617
@BlobTrigger(
618618
name = "content",
619619
path = "images/{name}",
620-
connection = "MyStorage") BlobClient blob,
620+
connection = "AzureWebJobsStorage") BlobClient blob,
621621
@BindingName("name") String file,
622622
ExecutionContext ctx)
623623
{
@@ -631,14 +631,32 @@ public void run(
631631
@BlobTrigger(
632632
name = "content",
633633
path = "images/{name}",
634-
connection = "MyStorage") BlobContainerClient container,
634+
connection = "AzureWebJobsStorage") BlobContainerClient container,
635635
ExecutionContext ctx)
636636
{
637637
container.listBlobs()
638638
.forEach(b -> ctx.getLogger().info(b.getName()));
639639
}
640640
```
641641

642+
**Note:** Only one SDK type can be used at a time at the moment.
643+
```java
644+
@FunctionName("checkAgainstInputBlob")
645+
public void run(
646+
@BlobInput(
647+
name = "inputBlob",
648+
path = "inputContainer/input.txt") BlobClient inputBlob,
649+
@BlobTrigger(
650+
name = "content",
651+
path = "images/{name}",
652+
connection = "AzureWebJobsStorage"
653+
dataType = "string") String triggerBlob,
654+
ExecutionContext ctx)
655+
{
656+
ctx.getLogger().info("Size = " + inputBlob.getProperties().getBlobSize());
657+
}
658+
```
659+
642660
* `dataType` on **@BlobTrigger** is **ignored** when you bind to an SDK-type.
643661
* `connection` can be a connection string **or** an identity-based prefix – both work with SDK-types.
644662

@@ -681,6 +699,7 @@ This is the **first** SDK-type preview. We plan to:
681699

682700
Give it a try in a test function app and tell us how much faster your blob processing becomes!
683701

702+
::: zone-end
684703

685704
## host.json properties
686705

0 commit comments

Comments
 (0)