How do I get the name of the input blob of my Azure WebJob? -


i'm using new azure webjobs feature , have simple trigger when new file comes 1 of blobs:

public static void processimportfile([blobinput("importjobsdata/{name}")] textreader input,                                     [bloboutput("importjobslog/log_{name}")] textwriter writer) {     writer.writeline("starting import file process...");      var result = inputdata(input, writer);      var status = result == 0 ? "success" : "fail";     var message = result == 0         ? "import success."         : "import fail. " + result + " records failed import. check logs details.";      writer.writeline(message); } 

what i'd name of file uploaded (ie. {name} property in data annotation) can write information writer (log) diagnostic purposes.

however, can't seem find properties of textreader/blobinput give me information.

i've done little digging , appears basestream property of textreader microsoft.windowsazure.jobs.watchablestream object. i'm not sure if helps track down name or not.

how go getting it?

the value of name capture passed arguments name well. should able that:

public static void processimportfile([blobinput("importjobsdata/{name}")] textreader input,                                      string name,                                      [bloboutput("importjobslog/log_{name}")] textwriter writer) {     writer.writeline(name); } 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -