![]() |
VOOZH | about |
dotnet add package Microsoft.Azure.WebJobs.Extensions.Storage.Blobs --version 5.3.7
NuGet\Install-Package Microsoft.Azure.WebJobs.Extensions.Storage.Blobs -Version 5.3.7
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage.Blobs" Version="5.3.7" />
<PackageVersion Include="Microsoft.Azure.WebJobs.Extensions.Storage.Blobs" Version="5.3.7" />Directory.Packages.props
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage.Blobs" />Project file
paket add Microsoft.Azure.WebJobs.Extensions.Storage.Blobs --version 5.3.7
#r "nuget: Microsoft.Azure.WebJobs.Extensions.Storage.Blobs, 5.3.7"
#:package Microsoft.Azure.WebJobs.Extensions.Storage.Blobs@5.3.7
#addin nuget:?package=Microsoft.Azure.WebJobs.Extensions.Storage.Blobs&version=5.3.7Install as a Cake Addin
#tool nuget:?package=Microsoft.Azure.WebJobs.Extensions.Storage.Blobs&version=5.3.7Install as a Cake Tool
This extension provides functionality for accessing Azure Storage Blobs in Azure Functions within the process.
Install the Storage Blobs extension with NuGet:
dotnet add package Microsoft.Azure.WebJobs.Extensions.Storage.Blobs
You need an Azure subscription and a Storage Account to use this package.
To create a new Storage Account, you can use the Azure Portal, Azure PowerShell, or the Azure CLI. Here's an example using the Azure CLI:
az storage account create --name <your-resource-name> --resource-group <your-resource-group-name> --location westus --sku Standard_LRS
In order for the extension to access Blobs, you will need the connection string which can be found in the Azure Portal or by using the Azure CLI snippet below.
az storage account show-connection-string -g <your-resource-group-name> -n <your-resource-name>
The connection string can be supplied through AzureWebJobsStorage app setting.
The Blob storage trigger starts a function when a new or updated blob is detected. The blob contents are provided as input to the function.
Please follow the tutorial to learn about triggering an Azure Function when a blob is modified.
Blob trigger offers handful of strategies when it comes to listening to blob creation and modification. The strategy can be customized by specifying Source property of the BlobTrigger (see examples below).
By default blob trigger uses polling which works as a hybrid between inspecting Azure Storage analytics logging and running periodic container scans. Blobs are scanned in groups of 10,000 at a time with a continuation token used between intervals.
Azure Storage analytics logging is not enabled by default, see Azure Storage analytics logging for how to enable it.
This strategy is not recommended for high-scale applications or scenarios that require low latency.
Blob storage events can be used to listen for changes. This strategy requires additional setup.
This strategy is recommended for high-scale applications.
The input binding allows you to read blob storage data as input to an Azure Function. The output binding allows you to modify and delete blob storage data in an Azure Function.
Please follow the input binding tutorial and output binding tutorial to learn about using this extension for accessing Blobs.
public static class BlobFunction_ReactToBlobChange
{
[FunctionName("BlobFunction")]
public static void Run(
[BlobTrigger("sample-container/sample-blob")] Stream blobStream,
ILogger logger)
{
using var blobStreamReader = new StreamReader(blobStream);
logger.LogInformation("Blob sample-container/sample-blob has been updated with content: {content}", blobStreamReader.ReadToEnd());
}
}
public static class BlobFunction_ReactToBlobChange_EventGrid
{
[FunctionName("BlobFunction")]
public static void Run(
[BlobTrigger("sample-container/sample-blob", Source = BlobTriggerSource.EventGrid)] Stream blobStream,
ILogger logger)
{
using var blobStreamReader = new StreamReader(blobStream);
logger.LogInformation("Blob sample-container/sample-blob has been updated with content: {content}", blobStreamReader.ReadToEnd());
}
}
public static class BlobFunction_ReadStream
{
[FunctionName("BlobFunction")]
public static void Run(
[BlobTrigger("sample-container/sample-blob-1")] Stream blobStream1,
[Blob("sample-container/sample-blob-2", FileAccess.Read)] Stream blobStream2,
ILogger logger)
{
using var blobStreamReader1 = new StreamReader(blobStream1);
logger.LogInformation("Blob sample-container/sample-blob-1 has been updated with content: {content}", blobStreamReader1.ReadToEnd());
using var blobStreamReader2 = new StreamReader(blobStream2);
logger.LogInformation("Blob sample-container/sample-blob-2 has content: {content}", blobStreamReader2.ReadToEnd());
}
}
public static class BlobFunction_WriteStream
{
[FunctionName("BlobFunction")]
public static async Task Run(
[BlobTrigger("sample-container/sample-blob-1")] Stream blobStream1,
[Blob("sample-container/sample-blob-2", FileAccess.Write)] Stream blobStream2,
ILogger logger)
{
await blobStream1.CopyToAsync(blobStream2);
logger.LogInformation("Blob sample-container/sample-blob-1 has been copied to sample-container/sample-blob-2");
}
}
public static class BlobFunction_String
{
[FunctionName("BlobFunction")]
public static void Run(
[BlobTrigger("sample-container/sample-blob-1")] string blobContent1,
[Blob("sample-container/sample-blob-2")] string blobContent2,
ILogger logger)
{
logger.LogInformation("Blob sample-container/sample-blob-1 has been updated with content: {content}", blobContent1);
logger.LogInformation("Blob sample-container/sample-blob-2 has content: {content}", blobContent2);
}
}
public static class BlobFunction_String_Write
{
[FunctionName("BlobFunction")]
public static void Run(
[BlobTrigger("sample-container/sample-blob-1")] string blobContent1,
[Blob("sample-container/sample-blob-2")] out string blobContent2,
ILogger logger)
{
logger.LogInformation("Blob sample-container/sample-blob-1 has been updated with content: {content}", blobContent1);
blobContent2 = blobContent1;
logger.LogInformation("Blob sample-container/sample-blob-1 has been copied to sample-container/sample-blob-2");
}
}
public static class BlobFunction_ByteArray
{
[FunctionName("BlobFunction")]
public static void Run(
[BlobTrigger("sample-container/sample-blob-1")] byte[] blobContent1,
[Blob("sample-container/sample-blob-2")] byte[] blobContent2,
ILogger logger)
{
logger.LogInformation("Blob sample-container/sample-blob-1 has been updated with content: {content}", Encoding.UTF8.GetString(blobContent1));
logger.LogInformation("Blob sample-container/sample-blob-2 has content: {content}", Encoding.UTF8.GetString(blobContent2));
}
}
public static class BlobFunction_ByteArray_Write
{
[FunctionName("BlobFunction")]
public static void Run(
[BlobTrigger("sample-container/sample-blob-1")] byte[] blobContent1,
[Blob("sample-container/sample-blob-2")] out byte[] blobContent2,
ILogger logger)
{
logger.LogInformation("Blob sample-container/sample-blob-1 has been updated with content: {content}", Encoding.UTF8.GetString(blobContent1));
blobContent2 = blobContent1;
logger.LogInformation("Blob sample-container/sample-blob-1 has been copied to sample-container/sample-blob-2");
}
}
public static class BlobFunction_TextReader_TextWriter
{
[FunctionName("BlobFunction")]
public static async Task Run(
[BlobTrigger("sample-container/sample-blob-1")] TextReader blobContentReader1,
[Blob("sample-container/sample-blob-2")] TextWriter blobContentWriter2,
ILogger logger)
{
while (blobContentReader1.Peek() >= 0)
{
await blobContentWriter2.WriteLineAsync(await blobContentReader1.ReadLineAsync());
}
logger.LogInformation("Blob sample-container/sample-blob-1 has been copied to sample-container/sample-blob-2");
}
}
public static class BlobFunction_BlobClient
{
[FunctionName("BlobFunction")]
public static async Task Run(
[BlobTrigger("sample-container/sample-blob-1")] BlobClient blobClient1,
[Blob("sample-container/sample-blob-2")] BlobClient blobClient2,
ILogger logger)
{
BlobProperties blobProperties1 = await blobClient1.GetPropertiesAsync();
logger.LogInformation("Blob sample-container/sample-blob-1 has been updated on: {datetime}", blobProperties1.LastModified);
BlobProperties blobProperties2 = await blobClient2.GetPropertiesAsync();
logger.LogInformation("Blob sample-container/sample-blob-2 has been updated on: {datetime}", blobProperties2.LastModified);
}
}
public static class BlobFunction_AccessContainer
{
[FunctionName("BlobFunction")]
public static async Task Run(
[BlobTrigger("sample-container/sample-blob")] Stream blobStream,
[Blob("sample-container")] BlobContainerClient blobContainerClient,
ILogger logger)
{
logger.LogInformation("Blobs within container:");
await foreach (BlobItem blobItem in blobContainerClient.GetBlobsAsync())
{
logger.LogInformation(blobItem.Name);
}
}
}
public static class BlobFunction_EnumerateBlobs_Stream
{
[FunctionName("BlobFunction")]
public static async Task Run(
[BlobTrigger("sample-container/sample-blob")] Stream blobStream,
[Blob("sample-container")] IEnumerable<Stream> blobs,
ILogger logger)
{
logger.LogInformation("Blobs contents within container:");
foreach (Stream content in blobs)
{
using var blobStreamReader = new StreamReader(content);
logger.LogInformation(await blobStreamReader.ReadToEndAsync());
}
}
}
public static class BlobFunction_EnumerateBlobs_BlobClient
{
[FunctionName("BlobFunction")]
public static void Run(
[BlobTrigger("sample-container/sample-blob")] Stream blobStream,
[Blob("sample-container")] IEnumerable<BlobClient> blobs,
ILogger logger)
{
logger.LogInformation("Blobs within container:");
foreach (BlobClient blob in blobs)
{
logger.LogInformation(blob.Name);
}
}
}
Please refer to sample functions app.
Please refer to Monitor Azure Functions for troubleshooting guidance.
Read the introduction to Azure Function or creating an Azure Function guide.
See the Storage CONTRIBUTING.md for details on building, testing, and contributing to this library.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit cla.microsoft.com.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact with any additional questions or comments.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 1 NuGet packages that depend on Microsoft.Azure.WebJobs.Extensions.Storage.Blobs:
| Package | Downloads |
|---|---|
|
Microsoft.Azure.WebJobs.Extensions.Storage
This extension adds bindings for Storage |
Showing the top 1 popular GitHub repositories that depend on Microsoft.Azure.WebJobs.Extensions.Storage.Blobs:
| Repository | Stars |
|---|---|
|
Azure-Samples/Serverless-microservices-reference-architecture
This reference architecture walks you through the decision-making process involved in designing, developing, and delivering a serverless application using a microservices architecture through hands-on instructions for configuring and deploying all of the architecture's components along the way. The goal is to provide practical hands-on experience in working with several Azure services and the technologies that effectively use them in a cohesive and unified way to build a serverless-based microservices architecture.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 5.3.7 | 799,065 | 10/30/2025 |
| 5.3.6 | 797,947 | 9/9/2025 |
| 5.3.4 | 1,689,167 | 2/11/2025 |
| 5.3.3 | 932,913 | 10/10/2024 |
| 5.3.2 | 998,741 | 9/19/2024 |
| 5.3.1 | 2,670,933 | 7/17/2024 |
| 5.3.0 | 1,820,859 | 4/19/2024 |
| 5.3.0-beta.1 | 1,863 | 4/16/2024 |
| 5.2.2 | 2,296,669 | 12/12/2023 |
| 5.2.1 | 2,030,570 | 9/25/2023 |
| 5.2.0 | 997,976 | 8/29/2023 |
| 5.1.3 | 1,285,053 | 6/26/2023 |
| 5.1.2 | 1,134,262 | 4/28/2023 |
| 5.1.1 | 597,759 | 3/24/2023 |
| 5.1.0 | 519,557 | 2/22/2023 |
| 5.1.0-beta.1 | 22,104 | 2/8/2023 |
| 5.0.1 | 7,803,965 | 5/3/2022 |
| 5.0.0 | 4,830,790 | 10/26/2021 |