Azure / Azure/azure-functions-host

Blob Trigger Throw OutOfMemoryException

Open
#4,063 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 10h
Merged PRs (30d)
36

Description

#### Description of Issue and steps to reproduce
Using default Blobtrigger type Azure Functions App:
1. Using a large file: 100Mb
1.1. Start debug in VS Code
1.2. Add file to Azure blob storage container
1.3. Blobtrigger app throws an OutOfMemoryException.
![image](https://user-images.githubusercontent.com/3672126/51608121-e5673a80-1f16-11e9-99a1-215b29f96f43.png)

2. Using a small file: 1Kb
2.1. Start debug session in VS Code
2.2. Add file to Azure blob storage container
2.3. Blobtrigger app triggers and succeeds
![image](https://user-images.githubusercontent.com/3672126/51608268-42fb8700-1f17-11e9-8caa-beac33dc38ef.png)

#### Workaround
Using default HTTPTrigger type Azure Function App:
SETUP
1. Add Blob type input binding
2. Set `"path": "/{query.filename}"`
3. Create an MS Flow which triggers when blob is added to the blob storage.
4. Add an HTTP request action
5. Pass the filename from the blob trigger action to the HTTP request action

USE
1. Add file to Azure blob storage container.
2. MS Flow will trigger
3. MS Flow will initiate an HTTP request with filename as parameter
4. HTTPTrigger App receives the request and uses the filename during runtime to configure the blob storage
5. HTTPTrigger App read all the data from the blob using: `InputBlob.read()`

NOTE:
When manually initiating an HTTP request, with filename of file in blob storage, the Function App also succeeds and provides access to the content of the blob via the `InputBlob.read()` method.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Azure Blob trigger in VS Code with the reported 100 MB and 1 KB files, then compare the OutOfMemoryException with the successful HTTP trigger workaround. The issue is resolved when the Blob trigger can process the large file without exhausting memory, with the existing reproduction steps used for verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.