3

I have a activity function that should store message in Blob storage.I can overwrite a file in blob storage but i need to store data in different name.how to do that? Azure function doesn't support dynamic binding in nodejs.

function.json

2
  • You want to define your own blob name or a random name like sys.randGuid is acceptable? Commented Nov 15, 2018 at 9:09
  • i have used "path" : "azureblob/{rand-guid}" it gives a unique name. but is there a way to specify the name? @JerryLiu Commented Nov 15, 2018 at 9:23

1 Answer 1

2

Find one workaround, see whether it's useful.

Along with blob output binding, there's an activity trigger to receive message msg, we can put self-defined blob name in msg for blob binding path to consume.

In your orchestrator function which calls Activity function

yield context.df.callActivity("YourActivity", {'body':'messagecontent','blobName':'myblob'});

Then Activity function code should be modified

context.bindings.myOutputBlob = context.bindings.msg.body;

And its function.json can use blobName as expected

{
  "bindings": [
    {
      "name": "msg",
      "type": "activityTrigger",
      "direction": "in"
    },
    {
      "name":"myOutputBlob",
      "direction": "out",
      "type": "blob",
      "connection": "AzureWebJobsStorage",
      "path": "azureblob/{blobName}"
    }
  ],
  "disabled": false
}
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.