1

I am working on a logic app where when a blob item is changed, I want to train a model. I have gotten to the point where I just want to get one of the items in the List of Files (I just want to model to train for ALL files in the container).

I have been searching the internet and really have not found anything that is simple to follow on how to achieve what I am wanting to do.

Does anyone have any ideas or resources to achieve this?

Thank you! Michael

espo
  • 37
  • 4

1 Answers1

1

For this requirement, I provide a sample for your reference.

1. Create a trigger "When a blob is added or modified (properties only)", click "Settings" of the trigger and set the Split On as "Off".

enter image description here

enter image description here

2. Then use "Get blob content" action and put the expression triggerBody()[0]?['Path'] into the "Blob" box.

enter image description here

If you want to get the first blob, just use the expression above. If want to get the second, use triggerBody()[1]?['Path']. If third....

3. When add files to container, the logic app will be triggered twice. The first time fails because of the triggerBody is empty list(I'm not sure why it will be triggered twice, maybe it's a bug). We do not need to worry about the first fail, the second trigger will success and we can get the result expected in second trigger. I added three files to the container, and the result show as blow:

enter image description here

enter image description here

Hury Shen
  • 11,526
  • 1
  • 4
  • 14