Skip to content

Latest commit

 

History

History
178 lines (106 loc) · 9.02 KB

functions-bindings-storage-blob.md

File metadata and controls

178 lines (106 loc) · 9.02 KB
title description ms.topic ms.date zone_pivot_groups
Azure Blob storage trigger and bindings for Azure Functions
Learn to use the Azure Blob storage trigger and bindings in Azure Functions.
reference
11/11/2022
programming-languages-set-functions-lang-workers

Azure Blob storage bindings for Azure Functions overview

Azure Functions integrates with Azure Storage via triggers and bindings. Integrating with Blob storage allows you to build functions that react to changes in blob data as well as read and write values.

Action Type
Run a function as blob storage data changes Trigger
Read blob storage data in a function Input binding
Allow a function to write blob storage data Output binding

::: zone pivot="programming-language-csharp"

Install extension

The extension NuGet package you install depends on the C# mode you're using in your function app:

Functions execute in the same process as the Functions host. To learn more, see Develop C# class library functions using Azure Functions.

Functions execute in an isolated C# worker process. To learn more, see Guide for running C# Azure Functions in an isolated worker process.

Functions run as C# script, which is supported primarily for C# portal editing. To update existing binding extensions for C# script apps running in the portal without having to republish your function app, see Update your extensions.


The functionality of the extension varies depending on the extension version:

[!INCLUDE functions-bindings-supports-identity-connections-note]

This version allows you to bind to types from Azure.Storage.Blobs. Learn more about how these new types are different from WindowsAzure.Storage and Microsoft.Azure.Storage and how to migrate to them from the Azure.Storage.Blobs Migration Guide.

This extension is available by installing the Microsoft.Azure.WebJobs.Extensions.Storage.Blobs NuGet package, version 5.x.

Using the .NET CLI:

dotnet add package Microsoft.Azure.WebJobs.Extensions.Storage.Blobs --version 5.0.0

[!INCLUDE functions-bindings-storage-extension-v5-tables-note]

Working with the trigger and bindings requires that you reference the appropriate NuGet package. Install the Microsoft.Azure.WebJobs.Extensions.Storage NuGet package, version 4.x. The package is used for .NET class libraries while the extension bundle is used for all other application types.

Functions 1.x apps automatically have a reference the Microsoft.Azure.WebJobs NuGet package, version 2.x.

[!INCLUDE functions-storage-sdk-version]

[!INCLUDE functions-bindings-supports-identity-connections-note]

This version allows you to bind to types from Azure.Storage.Blobs. Learn more about how these new types are different from WindowsAzure.Storage and Microsoft.Azure.Storage and how to migrate to them from the Azure.Storage.Blobs Migration Guide.

Add the extension to your project by installing the Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs NuGet package, version 5.x.

Using the .NET CLI:

dotnet add package Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs --version 5.0.0

[!INCLUDE functions-bindings-storage-extension-v5-isolated-worker-tables-note]

Add the extension to your project by installing the Microsoft.Azure.Functions.Worker.Extensions.Storage NuGet package, version 4.x.

Functions version 1.x doesn't support isolated worker process.

[!INCLUDE functions-bindings-supports-identity-connections-note]

This extension version is available from the extension bundle v3 by adding the following lines in your host.json file:

[!INCLUDE functions-extension-bundles-json-v3]

To learn more, see Update your extensions.

You can install this version of the extension in your function app by registering the extension bundle, version 2.x.

Functions 1.x apps automatically have a reference to the Microsoft.Azure.WebJobs NuGet package, version 2.x.


::: zone-end

::: zone pivot="programming-language-javascript,programming-language-python,programming-language-java,programming-language-powershell"

Install bundle

The Blob storage binding is part of an extension bundle, which is specified in your host.json project file. You may need to modify this bundle to change the version of the binding, or if bundles aren't already installed. To learn more, see extension bundle.

[!INCLUDE functions-bindings-supports-identity-connections-note]

You can add this version of the extension from the extension bundle v3 by adding or replacing the following code in your host.json file:

[!INCLUDE functions-extension-bundles-json-v3]

To learn more, see Update your extensions.

You can install this version of the extension in your function app by registering the extension bundle, version 2.x.

Functions 1.x apps automatically have a reference to the extension.


::: zone-end

host.json settings

This section describes the function app configuration settings available for functions that use this binding. These settings only apply when using extension version 5.0.0 and higher. The example host.json file below contains only the version 2.x+ settings for this binding. For more information about function app configuration settings in versions 2.x and later versions, see host.json reference for Azure Functions.

Note

This section doesn't apply to extension versions before 5.0.0. For those earlier versions, there aren't any function app-wide configuration settings for blobs.

{
    "version": "2.0",
    "extensions": {
        "blobs": {
            "maxDegreeOfParallelism": 4
        }
    }
}
Property Default Description
maxDegreeOfParallelism 8 * (the number of available cores) The integer number of concurrent invocations allowed for each blob-triggered function. The minimum allowed value is 1.

Next steps