0

Iam new to azure, any help is appreciated

In azure function we can give an input binding as below.

[QueueTrigger("myqueue-items")] string myQueueItem,
    [Blob("samples-workitems/{queueTrigger}", FileAccess.Read)] Stream myBlob,
    ILogger log)

Also, I see few codes where we use the below and they dont add the above lines. Can anyone explain the usage of these both.

BlobServiceClient blobServiceClient = new BlobServiceClient(connectionString);
BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(ContainerName);
BlobClient blobClient = containerClient.GetBlobClient(fileName);

I have tried both the procedures and both of them works fine. I wanted to understand the significance of the usage

1 Answer 1

1

The first example is using input bindings for Functions. You can think of them like "managed connections". You dont need to worry about how the Blob in that case is being fetched from the storage account. It is abstracted away from you.

However, if you need more control over that, the second one comes into play. You are creating your own BlobClient etc with all the options available. This you could use anywhere, not just with Azure Functions.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.