Search code examples
azureazure-storageazure-blob-storageazure-logic-apps

Dynamically get blob contents when a new folder gets created in the storage account container using Azure Logic Apps


I'm using an Azure Logic App to get Blob contents from my Storage Account. My storage account has a container with 2 subdirectories. Eg. Container > Pics > 202001 > Pic1.png The second sub-directory will change every month. (eg. 202002, 202003) So I need to dynamically get all the contents from the new sub-directory created, without manually having to enter the path of the newly created folder in my logic app designer.

Is there a way to achieve this?

Any help will be greatly appreciated!


Solution

  • Your subdirectories are very regular, so easy to do, you only need to use time-related functions.

    Your container path can be written like this:

    /gong/test1/@{formatDateTime(utcNow(),'yyyyMM')}/
    

    enter image description here

    I did a test and it seems to trigger correctly:

    enter image description here