Skip to content

Commit c5902cf

Browse files
committed
Initial updates from Ahmed
1 parent c6a820e commit c5902cf

File tree

4 files changed

+124
-136
lines changed

4 files changed

+124
-136
lines changed

articles/azure-functions/functions-app-settings.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: App settings reference for Azure Functions
33
description: Reference documentation for the Azure Functions app settings or environment variables used to configure functions apps.
44
ms.topic: conceptual
55
ms.custom: devx-track-extended-java, devx-track-python, ignite-2023, build-2024, linux-related-content
6-
ms.date: 07/11/2024
6+
ms.date: 06/04/2025
77
---
88

99
# App settings reference for Azure Functions
@@ -492,6 +492,18 @@ This setting enables the Python worker to use shared memory to improve throughpu
492492

493493
With this setting enabled, you can use the [DOCKER_SHM_SIZE](#docker_shm_size) setting to set the shared memory size. To learn more, see [Shared memory](functions-reference-python.md#shared-memory).
494494

495+
## JAVA_ENABLE_SDK_TYPES
496+
497+
Enables your function app to use native Azure SDK types in bindings.
498+
499+
[!INCLUDE [functions-java-sdk-types-preview-note](../../includes/functions-java-sdk-types-preview-note.md)]
500+
501+
|Key|Sample value|
502+
|---|------------|
503+
|JAVA_ENABLE_SDK_TYPES|`true`|
504+
505+
For more information, see [SDK types](functions-reference-java.md#sdk-types) in the Java reference article
506+
495507
## JAVA_OPTS
496508

497509
Used to customize the Java virtual machine (JVM) used to run your Java functions when running on a [Premium plan](./functions-premium-plan.md) or [Dedicated plan](./dedicated-plan.md). When running on a Consumption plan, instead use `languageWorkers__java__arguments`. For more information, see [Customize JVM](functions-reference-java.md#customize-jvm).

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

Lines changed: 6 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Azure Blob storage trigger for Azure Functions
33
description: Learn how to use Azure Function to run your custom code based on changes in an Azure Blob storage container.
44
ms.topic: reference
5-
ms.date: 05/14/2024
5+
ms.date: 05/14/2025
66
ms.devlang: csharp
77
# ms.devlang: csharp, java, javascript, powershell, python
88
ms.custom:
@@ -68,7 +68,7 @@ For more information about the `BlobTrigger` attribute, see [Attributes](#attrib
6868
::: zone-end
6969
::: zone pivot="programming-language-java"
7070

71-
This function writes a log when a blob is added or updated in the `myblob` container.
71+
This function uses a byte array to write a log when a blob is added or updated in the `myblob` container.
7272

7373
```java
7474
@FunctionName("blobprocessor")
@@ -84,6 +84,8 @@ public void run(
8484
}
8585
```
8686

87+
This example
88+
8789
::: zone-end
8890
::: zone pivot="programming-language-typescript"
8991

@@ -444,7 +446,8 @@ If you get an error message when trying to bind to one of the Storage SDK types,
444446
::: zone-end
445447

446448
::: zone pivot="programming-language-java"
447-
The `@BlobTrigger` attribute is used to give you access to the blob that triggered the function. Refer to the [trigger example](#example) for details.
449+
450+
[!INCLUDE [functions-java-sdk-types-preview-note](../../includes/functions-java-sdk-types-preview-note.md)]
448451
::: zone-end
449452
::: zone pivot="programming-language-javascript,programming-language-typescript"
450453
# [Model v4](#tab/nodejs-v4)
@@ -583,130 +586,6 @@ Because the blob trigger uses a queue internally, the maximum number of concurre
583586

584587
Limits apply separately to each function that uses a blob trigger.
585588

586-
::: zone pivot="programming-language-java"
587-
## Preview SDK-types for Blob Storage
588-
589-
### What this preview delivers
590-
591-
Until now a Blob-triggered Java function could receive only raw bytes or strings.
592-
The new **SDK-type binding** lets your function accept a *real* Azure Storage SDK client – either `BlobClient` or `BlobContainerClient`.
593-
594-
* Use every Storage API (leases, tiers, snapshots, …) directly.
595-
* Stream data straight from Storage – no 100 MB blob-size ceiling, no extra memory copies.
596-
* One client instance is cached and reused across invocations for maximum throughput.
597-
598-
### Why you might switch
599-
600-
| Classic binding (`byte[]` / `String`) | SDK-type binding (`BlobClient`, `BlobContainerClient`) |
601-
| -------------------------------------------- | ------------------------------------------------------------ |
602-
| Host downloads blob, sends it to the worker. | Worker streams from Storage itself – lower latency & memory. |
603-
| 100 MB size limit. | No hard limit; streams as big as Storage allows. |
604-
| Only read/write bytes. | Full SDK surface: metadata, ACLs, legal hold, etc. |
605-
606-
### What you need
607-
608-
* Turn the feature on by setting `JAVA_ENABLE_SDK_TYPES` to `"true"` in your
609-
app's settings.
610-
* **azure-functions-maven-plugin** (or Gradle plug-in) ≥ **1.38.0** – detects SDK-type parameters during build and adds the flag that activates the middleware.
611-
* Your function app must reference:
612-
613-
* `azure-storage-blob` (always)
614-
* `azure-identity` (only if you plan to use Managed Identity)
615-
616-
> The worker creates clients via reflection, so it relies on whatever Storage/Identity libraries you ship with the function.
617-
618-
### Authoring – it looks just like a normal binding
619-
620-
```java
621-
@FunctionName("processBlob")
622-
public void run(
623-
@BlobTrigger(
624-
name = "content",
625-
path = "images/{name}",
626-
connection = "AzureWebJobsStorage") BlobClient blob,
627-
@BindingName("name") String file,
628-
ExecutionContext ctx)
629-
{
630-
ctx.getLogger().info("Size = " + blob.getProperties().getBlobSize());
631-
}
632-
```
633-
634-
```java
635-
@FunctionName("containerOps")
636-
public void run(
637-
@BlobTrigger(
638-
name = "content",
639-
path = "images/{name}",
640-
connection = "AzureWebJobsStorage") BlobContainerClient container,
641-
ExecutionContext ctx)
642-
{
643-
container.listBlobs()
644-
.forEach(b -> ctx.getLogger().info(b.getName()));
645-
}
646-
```
647-
648-
**Note:** Only one SDK type can be used at a time at the moment.
649-
```java
650-
@FunctionName("checkAgainstInputBlob")
651-
public void run(
652-
@BlobInput(
653-
name = "inputBlob",
654-
path = "inputContainer/input.txt") BlobClient inputBlob,
655-
@BlobTrigger(
656-
name = "content",
657-
path = "images/{name}",
658-
connection = "AzureWebJobsStorage"
659-
dataType = "string") String triggerBlob,
660-
ExecutionContext ctx)
661-
{
662-
ctx.getLogger().info("Size = " + inputBlob.getProperties().getBlobSize());
663-
}
664-
```
665-
666-
* `dataType` on **@BlobTrigger** is **ignored** when you bind to an SDK-type.
667-
* `connection` can be a connection string **or** an identity-based prefix – both work with SDK-types.
668-
669-
### What happens under the hood (in one minute)
670-
671-
1. **Build:** the Maven plug-in scans your methods. If it sees `BlobClient` or `BlobContainerClient` it writes `"supportsDeferredBinding": true` into `function.json`.
672-
2. **Startup:** the worker notices the flag and inserts **SdkTypeMiddleware** before your function executes.
673-
3. **Invocation:** for each SDK-typed parameter the middleware
674-
675-
* reads the binding metadata,
676-
* looks in the **WorkerObjectCache**; if no entry exists it uses reflection to construct the client,
677-
* injects the client into the argument list.
678-
679-
The cache key is derived from container name + blob name (or just container, for `BlobContainerClient`) plus the connection prefix. Thus identical invocations reuse one client; distinct blobs get their own.
680-
681-
682-
### Managed Identity
683-
684-
SDK-types honor the same identity-based connection settings you already use with classic bindings.
685-
Simply point `connection` to an MI prefix and add `azure-identity` to your function’s dependencies – the worker will build `DefaultAzureCredential` reflectively.
686-
(No additional steps are required in the worker.)
687-
688-
### Troubleshooting
689-
690-
| Exception | Meaning |
691-
| -------------------------- | ---------------------------------------------------------------------------------------------------------------- |
692-
| `SdkAnalysisException` | Build plug-in couldn’t create metadata (duplicate SDK-types in one signature, unsupported parameter type, etc.). |
693-
| `SdkRegistryException` | Runtime doesn’t recognize the stored FQCN – probably mismatched library versions. |
694-
| `SdkHydrationException` | Middleware failed to build the SDK client (missing env-vars, reflection error, credential failure). |
695-
| `SdkTypeCreationException` | Factory couldn’t turn metadata into the final SDK-type (usually casting issues). |
696-
697-
Check the inner message for the exact cause; most issues are mis-spelled environment variables or missing dependencies.
698-
699-
### Future work
700-
701-
This is the **first** SDK-type preview. We plan to:
702-
703-
* Add more Storage client types, then branch into Cosmos DB, Event Hubs, etc.
704-
* Promote the feature to General Availability once telemetry shows it’s solid.
705-
706-
Give it a try in a test function app and tell us how much faster your blob processing becomes!
707-
708-
::: zone-end
709-
710589
## host.json properties
711590

712591
The [host.json](functions-host-json.md#blobs) file contains settings that control blob trigger behavior. See the [host.json settings](functions-bindings-storage-blob.md#hostjson-settings) section for details regarding available settings.

articles/azure-functions/functions-reference-java.md

Lines changed: 95 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Java developer reference for Azure Functions
33
description: Understand how to develop functions with Java.
44
ms.topic: conceptual
5-
ms.date: 09/14/2018
5+
ms.date: 06/04/2025
66
ms.devlang: java
77
ms.custom: devx-track-java, devx-track-extended-java, devx-track-azurecli
88
---
@@ -142,7 +142,7 @@ Here's the generated corresponding `function.json` by the [azure-functions-maven
142142

143143
## Java versions
144144

145-
The version of Java on which your app runs in Azure is specified in the pom.xml file. The Maven archetype currently generates a pom.xml for Java 8, which you can change before publishing. The Java version in pom.xml should match the version on which you've locally developed and tested your app.
145+
The version of Java on which your app runs in Azure is specified in the pom.xml file. The Maven archetype currently generates a pom.xml for Java 8, which you can change before publishing. The Java version in pom.xml should match the version of Java on which you develop and test your app locally.
146146

147147
### Supported versions
148148

@@ -158,7 +158,7 @@ Unless you specify a Java version for your deployment, the Maven archetype defau
158158

159159
### Specify the deployment version
160160

161-
You can control the version of Java targeted by the Maven archetype by using the `-DjavaVersion` parameter. The value of this parameter can be either `8`, `11`, `17` or `21`.
161+
You can control the version of Java targeted by the Maven archetype by using the `-DjavaVersion` parameter. This parameter must match [supported Java versions](supported-languages.md?pivots=programming-language-java#languages-by-runtime-version).
162162

163163
The Maven archetype generates a pom.xml that targets the specified Java version. The following elements in pom.xml indicate the Java version to use:
164164

@@ -269,7 +269,9 @@ The `com.microsoft.azure.functions:azure-functions-java-library` dependency is p
269269

270270
## Data type support
271271

272-
You can use Plain old Java objects (POJOs), types defined in `azure-functions-java-library`, or primitive data types such as String and Integer to bind to input or output bindings.
272+
You can use plain-old Java objects (POJOs), types defined in `azure-functions-java-library`, or primitive data types such as `String` and `Integer` to bind to input or output bindings.
273+
274+
[!INCLUDE [functions-java-sdk-types-preview-note](../../includes/functions-java-sdk-types-preview-note.md)]
273275

274276
### POJOs
275277

@@ -293,6 +295,91 @@ Bind binary inputs or outputs to `byte[]`, by setting the `dataType` field in yo
293295

294296
If you expect null values, use `Optional<T>`.
295297

298+
### SDK types (preview)
299+
300+
You can currently use these native SDK types in your bindings:
301+
302+
+ Blob Storage SDK: `BlobClient` and `BlobContainerClient`
303+
304+
When you use these native SDK types, your functions can use client types to access streams directly from storage, which provides these benefits over POJOs or binary types:
305+
306+
+ Lower latency
307+
+ Reduced memory requirements
308+
+ Removes request-based size limits (uses service defaults)
309+
+ Provides access to the full SDK surface: metadata, ACLs, legal holds, and other SDK-specific data.
310+
311+
#### Requirements
312+
313+
* Set the [`JAVA_ENABLE_SDK_TYPES`](./functions-app-settings.md#java_enable_sdk_types) app setting to `true` to enable SDK types.
314+
* `azure-functions-maven-plugin` (or Gradle plug-in) version `1.38.0` or a higher version.
315+
316+
#### Examples
317+
318+
```java
319+
@FunctionName("processBlob")
320+
public void run(
321+
@BlobTrigger(
322+
name = "content",
323+
path = "images/{name}",
324+
connection = "AzureWebJobsStorage") BlobClient blob,
325+
@BindingName("name") String file,
326+
ExecutionContext ctx)
327+
{
328+
ctx.getLogger().info("Size = " + blob.getProperties().getBlobSize());
329+
}
330+
```
331+
332+
```java
333+
@FunctionName("containerOps")
334+
public void run(
335+
@BlobTrigger(
336+
name = "content",
337+
path = "images/{name}",
338+
connection = "AzureWebJobsStorage") BlobContainerClient container,
339+
ExecutionContext ctx)
340+
{
341+
container.listBlobs()
342+
.forEach(b -> ctx.getLogger().info(b.getName()));
343+
}
344+
```
345+
346+
347+
```java
348+
@FunctionName("checkAgainstInputBlob")
349+
public void run(
350+
@BlobInput(
351+
name = "inputBlob",
352+
path = "inputContainer/input.txt") BlobClient inputBlob,
353+
@BlobTrigger(
354+
name = "content",
355+
path = "images/{name}",
356+
connection = "AzureWebJobsStorage",
357+
dataType = "string") String triggerBlob,
358+
ExecutionContext ctx)
359+
{
360+
ctx.getLogger().info("Size = " + inputBlob.getProperties().getBlobSize());
361+
}
362+
```
363+
364+
#### Considerations
365+
366+
+ The `dataType` setting on `@BlobTrigger` is ignored when binding to an SDK type.
367+
+ Currently, only one SDK type can be used at a time in a given function definition. If your function has both a Blog trigger or Input binding and a Blob output binding, one binding can use an SDK type (such as `BlobClient`) and the others must use a native type or POJO.
368+
+ You can use managed identities with SDK types.
369+
370+
#### Troubleshooting
371+
372+
These are potential errors that might occur when using SDK types:
373+
374+
| Exception | Meaning |
375+
| ----- | ----- |
376+
| `SdkAnalysisException` | Build plug-in couldn’t create metadata. This might be due to duplicate SDK-types in a single function definition, an unsupported parameter type, or some other misconfiguration. |
377+
| `SdkRegistryException` | Runtime doesn’t recognize the stored FQCN, which can be caused by mismatched library versions. |
378+
| `SdkHydrationException` | Middleware failed to build the SDK client, which can occur due to missing environment variables, reflection errors, credential failures, and similar runtime issues. |
379+
| `SdkTypeCreationException` | Factory couldn’t turn metadata into the final SDK type, which is usually caused by a casting issues. |
380+
381+
Check the inner message for more details about the exact cause. Most SDK types issues are caused by misspelled environment variable names or missing dependencies.
382+
296383
## Bindings
297384

298385
Input and output bindings provide a declarative way to connect to data from within your code. A function can have multiple input and output bindings.
@@ -415,7 +502,7 @@ You invoke this function on an `HttpRequest` object. It writes multiple values t
415502

416503
## HttpRequestMessage and HttpResponseMessage
417504

418-
These are defined in `azure-functions-java-library`. They're helper types to work with HttpTrigger functions.
505+
These helper types, which are designed to work with HTTP Trigger functions, are defined in `azure-functions-java-library`:
419506

420507
| Specialized type | Target | Typical usage |
421508
| --------------------- | :-----------------: | ------------------------------ |
@@ -465,7 +552,7 @@ In the preceding example, the `queryValue` is bound to the query string paramete
465552
466553
## Execution context
467554

468-
`ExecutionContext`, defined in the `azure-functions-java-library`, contains helper methods to communicate with the functions runtime. For more information, see the [ExecutionContext reference article](/java/api/com.microsoft.azure.functions.executioncontext).
555+
`ExecutionContext`, defined in the `azure-functions-java-library`, contains helper methods that are used to communicate with the functions runtime. For more information, see the [ExecutionContext reference article](/java/api/com.microsoft.azure.functions.executioncontext).
469556

470557
### Logger
471558

@@ -532,7 +619,7 @@ To download the log files as a single ZIP file by using the Azure CLI, open a ne
532619
az webapp log download --resource-group resourcegroupname --name functionappname
533620
```
534621

535-
You must have enabled file system logging in the Azure portal or the Azure CLI before running this command.
622+
You must enable file system logging in the Azure portal or the Azure CLI before running this command.
536623

537624
## Environment variables
538625

@@ -552,7 +639,7 @@ public class Function {
552639
```
553640
## Use dependency injection in Java Functions
554641

555-
Azure Functions Java supports the dependency injection (DI) software design pattern, which is a technique to achieve [Inversion of Control (IoC)](/dotnet/architecture/modern-web-apps-azure/architectural-principles#dependency-inversion) between classes and their dependencies. Java Azure Functions provides a hook to integrate with popular Dependency Injection frameworks in your Functions Apps. [Azure Functions Java SPI](https://github.com/Azure/azure-functions-java-additions/tree/dev/azure-functions-java-spi) contains an interface [FunctionInstanceInjector](https://github.com/Azure/azure-functions-java-additions/blob/dev/azure-functions-java-spi/src/main/java/com/microsoft/azure/functions/spi/inject/FunctionInstanceInjector.java). By implementing this interface, you can return an instance of your function class and your functions will be invoked on this instance. This gives frameworks like [Spring](/azure/developer/java/spring-framework/getting-started-with-spring-cloud-function-in-azure?toc=%2Fazure%2Fazure-functions%2Ftoc.json), [Quarkus](/azure/azure-functions/functions-create-first-quarkus), Google Guice, Dagger, etc. the ability to create the function instance and register it into their IOC container. This means you can use those Dependency Injection frameworks to manage your functions naturally.
642+
Azure Functions Java supports the dependency injection (DI) software design pattern, which is a technique to achieve [Inversion of Control (IoC)](/dotnet/architecture/modern-web-apps-azure/architectural-principles#dependency-inversion) between classes and their dependencies. Java Azure Functions provides a hook to integrate with popular Dependency Injection frameworks in your Functions Apps. [Azure Functions Java SPI](https://github.com/Azure/azure-functions-java-additions/tree/dev/azure-functions-java-spi) contains an interface [FunctionInstanceInjector](https://github.com/Azure/azure-functions-java-additions/blob/dev/azure-functions-java-spi/src/main/java/com/microsoft/azure/functions/spi/inject/FunctionInstanceInjector.java). By implementing this interface, you can return an instance of your function class and your functions are invoked on this instance. This gives frameworks like [Spring](/azure/developer/java/spring-framework/getting-started-with-spring-cloud-function-in-azure?toc=%2Fazure%2Fazure-functions%2Ftoc.json), [Quarkus](/azure/azure-functions/functions-create-first-quarkus), Google Guice, Dagger, etc. the ability to create the function instance and register it into their IOC container. This means you can use those Dependency Injection frameworks to manage your functions naturally.
556643

557644
> [!NOTE]
558645
> Microsoft Azure Functions Java SPI Types ([azure-function-java-spi](https://mvnrepository.com/artifact/com.microsoft.azure.functions/azure-functions-java-spi/1.0.0)) is a package that contains all SPI interfaces for third parties to interact with Microsoft Azure functions runtime.

0 commit comments

Comments
 (0)