When you want to create a new blob in your code Azure Functions

kemurayama

kemurayama

Posted on April 25, 2020

When you want to create a new blob in your code Azure Functions

You can create a new blob file by writing like below.
Plus {rand-guid} generate guid. It is useful !!

Storage Account Setting is set by Storage Account Attribute.

[FunctionName("MyTestFuncion")]
[StorageAccount("StorageConnectionAppSetting")]

public static async Task Run([EventHubTrigger("myeh", Connection = "EHConnection")] EventData[] events,
        Binder binder,
        ILogger log)
    ...

    using (var writer = await binder.BindAsync<TextWriter>(
                        new BlobAttribute("<container>/{rand-guid}.json")))
                    {
                        writer.Write(<what you want to write>);
                    }
Enter fullscreen mode Exit fullscreen mode
đź’– đź’Ş đź™… đźš©
kemurayama
kemurayama

Posted on April 25, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related