Skip to content

Ensure collection support works for blob storage input bindings #1156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
liliankasem opened this issue Nov 7, 2022 · 3 comments
Closed

Ensure collection support works for blob storage input bindings #1156

liliankasem opened this issue Nov 7, 2022 · 3 comments

Comments

@liliankasem
Copy link
Member

liliankasem commented Nov 7, 2022

With the introduction of deferred binding via using ParameterBindingData/ModelBindingData to enable SDK-type bindings such as BlobClient in the worker, we need to make sure we also support the collection scenario. Meaning, we should be able to bind to IEnumerable<BlobClient> blobs.

Example:

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);
        }
    }
}

Investigate if this works out of the box with the blob converter we have in place today. If this use case is not working, update the converter and other necessary code paths to enable this scenario

Notes

@ghost ghost assigned jviau Nov 7, 2022
@liliankasem liliankasem changed the title Ensure cardinality support works for Blob triggers and input bindings Ensure cardinality support works for blob storage input bindings Nov 7, 2022
@liliankasem liliankasem changed the title Ensure cardinality support works for blob storage input bindings Ensure collection support works for blob storage input bindings Nov 7, 2022
@fabiocav fabiocav added this to the Functions Sprint 134 milestone Nov 9, 2022
@surgupta-msft
Copy link
Contributor

surgupta-msft commented Nov 23, 2022

Update:

Changes done in feature branches -

  1. Blob Extensions - sdk-bindings/collection-support. Add changes to the Extensions PR
  2. Host - sdk-bindings/collection-support-host
  3. Dotnet Worker - sdk-bindings/collection-support
  4. Protobuf - FunctionRpc.proto

Above changes work when cardinality is assigned correctly. Tracking it separately -

  1. [Bug] FunctionMetadataGenerator does not assign cardinality as many for IEnumerable<> scenarios #1204

@fabiocav
Copy link
Member

Work here is close to completion. Moving to sprint 135 so we can iterate on PRs

@surgupta-msft
Copy link
Contributor

Closing this issue. Open PRs will be tracked through Epic - #1081

@ghost ghost locked as resolved and limited conversation to collaborators Jan 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants