liveBook · Manning

Input binding

As explained in Microsoft Azure in Action

An input binding is an Azure Functions binding that supplies data from an external resource to a function.

An input binding lets an Azure Function receive data from an external resource without writing all the connection plumbing yourself. For Blob Storage, it maps a blob path such as originalnfts/{nftid} to a readable stream. section 8.2.2

Resize an NFT without touching the original

A ProcessNFT HTTP-triggered function reads an image from originalnfts/{nftid}, resizes it, and writes the result to copynfts/{nftid}. FileAccess.Read protects the source; a separate output binding uses FileAccess.Write. With Azurite and VS Code, place an image in the container, run the function locally, and call /api/nft/{nftid}. section 8.2.2

[FunctionName("ProcessNFT")]
public static void Run(
    [HttpTrigger(AuthorizationLevel.Anonymous, 
"get", "post", Route = "nft/{nftid}")] HttpRequest req,    #1
    [Blob("originalnfts/{nftid}", FileAccess.Read)] 
Stream nftImage,    #2
    [Blob("copynfts/{nftid}", FileAccess.Write)] 
Stream nftSmall)    #3
{
    IImageFormat format;

    using (Image<Rgba32> input = 
Image.Load<Rgba32>(nftImage, out format))    #4
    {
        input.Mutate(x => x.Resize(320, 200));    #5
        input.Save(nftSmall, format);    #6
    }
}

The annotated function shows the route, readable Blob input stream, writable output stream, image transformation, and save operation. section 8.2.2

How Microsoft Azure in Action covers it

How deep it goes
Demonstrates path templates, stream access modes, local execution, and input-output flow, but not broader binding configuration.
Examples
Uses an NFT image resize workflow with originalnfts/{nftid} as input and copynfts/{nftid} as output.
What it assumes
Assumes a Function project and Blob container, while demonstrating package references, storage extensions, Azurite, and local invocation.
What you can do after
Apply it via Azure Functions to read Blob Storage data and pass it into processing code.
How it connects
Links Azure Functions with Blob Storage, HTTP triggers, output bindings, and the Azurite emulator.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microsoft Azure in Action. The section links point to the parts of the book it draws on.