C# Azure BlobTrigger -> Get the URL of the uploaded blob

Viewed 304

How can I get the URL of the BLOB which triggers the "BLOBTrigger"? Getting the name works with the {name} section but I also need the URL.

[FunctionName("Function1")]
        public static async Task RunAsync(
            [BlobTrigger("input/{name}", Connection = "AzureWebJobsStorage")] Stream myBlob,
            [Blob("output/{name}", FileAccess.Write, Connection = "AzureWebJobsStorage")] Stream outputBlob,
            string name,
            ILogger log)
        {
            
            log.LogInformation($"C# Blob trigger function Processed blob\n Name:{name}");
            //log.LogInformation("HERE I NEED THE URL");
            log.LogInformation("*******************----**********************");            
        }

Thanks for your help.

1 Answers

You can get input as CloudBlockBlob, then you can get the properties. Blob path is in the properties.

Related