Home
%3CLINGO-SUB%20id%3D%22lingo-sub-838870%22%20slang%3D%22en-US%22%3EDelete%20all%20the%20Azure%20Storage%20Blob%20content%20before%20N%20days%20using%20Logic%20App%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-838870%22%20slang%3D%22en-US%22%3E%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EPrerequisites%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3EBlob%20Storage%20account%20which%20has%20the%20blobs%20inside%20which%20needs%20to%20be%20deleted%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130246iD9B0E85AB3A2179D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%221.png%22%20title%3D%221.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%20box-sizing%3A%20border-box%3B%20orphans%3A%202%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAction%3A%3C%2FP%3E%0A%3CP%3E1-%20Create%20the%20Logic%20App%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20454px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130248i27162C72381A10E2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222.png%22%20title%3D%222.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E2-%20As%20soon%20as%20you%20create%20the%20Logic%20app%2C%20you%20get%20to%20go%20to%20Designer%20part%20of%20it.%20Since%20we%20are%20creating%20the%20recurrence%20logic%2C%20we%20can%20start%20with%20inbuilt%20recurrence%20trigger%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130249i72F9B23ACE5255DF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%223.png%22%20title%3D%223.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E3-%20Once%20you%20select%20the%20recurrence%20trigger%2C%20you%20get%20the%20screen%20where%20you%20can%20set%20the%20number%20of%20recurrences%20based%20on%20the%20need.%20As%20in%20below%20screen%20shot%20my%20logic%20will%20run%20once%20in%20every%20week%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130250iD67B24B127F2288C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%224.png%22%20title%3D%224.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E4-%26nbsp%3BAfter%20this%20you%20select%20the%20%E2%80%9CNew%20Step%E2%80%9D%20where%20you%20get%20chance%20to%20select%20your%20blob%20storage.%20Search%20for%20Azure%20Blob%20Storage%20and%20select%20it%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130251i83B8DA00AFFA7FDB%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%225.png%22%20title%3D%225.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E5-After%20selecting%20the%20Blob%20storage%2C%20you%20have%20to%20select%20the%20action%20on%20that%20storage%20and%20we%20will%20select%20the%20list%20blobs%20operation%20since%20we%20will%20be%20listing%20the%20blobs%20first%20and%20then%20will%20perform%20further%20actions%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130252i5B849C02E27A4742%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%226.png%22%20title%3D%226.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E6-After%20this%20we%20need%20to%20select%20the%20Storage%20account%20where%20we%20need%20to%20list%20and%20delete%20the%20blobs%20and%20give%20connection%20name%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130253iA4442F495D0D68B9%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%227.png%22%20title%3D%227.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EClick%20create%20button%20and%20then%20we%20need%20to%20select%20the%20container%20where%20our%20blobs%20reside%20and%20then%20click%20on%20new%20step%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130254i82AC89A38E856236%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%228.png%22%20title%3D%228.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E7-%26nbsp%3BNext%20step%2C%20we%20will%20create%20the%20Array%20where%20those%20blobs%20will%20be%20residing%20after%20fetching%20it.%20So%2C%20search%20for%20%E2%80%9CFilter%20Array%E2%80%9D%20keyword%20and%20select%20it%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130256i47881E335E155E0A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%229.png%22%20title%3D%229.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E8-%26nbsp%3BAfter%20Array%20selection%2C%20we%20need%20to%20select%20the%20dynamic%20value%20which%20will%20be%20iterated%20from%20the%20array%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130260iBDAC6D55246FAB9E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2210.png%22%20title%3D%2210.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThen%20click%20on%20the%20%E2%80%9CEdit%20in%20advanced%20mode%E2%80%9D%20and%20provide%20this%20query%20%3CSTRONG%3E%E2%80%9C%40less(item()%3F%5B'LastModified'%5D%2C%20addDays(utcNow()%2C%20-7))%E2%80%9D%20%3C%2FSTRONG%3Ewhich%20means%20that%20we%20will%20be%20checking%20the%20%E2%80%9CLastModified%E2%80%9D%20field%20and%20will%20filter%20which%20are%20later%20than%207%20days%20from%20today(%20you%20can%20change%20this%20value%20as%20per%20your%20need).%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130261i02D80396485D11B6%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2217.png%22%20title%3D%2217.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E9%3AClick%20on%20New%20Step%20and%20search%20for%20the%20%E2%80%9Cfor%20each%E2%80%9D%20for%20looping%20the%20array%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130262i09797D68E3B3B053%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2211.png%22%20title%3D%2211.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAfter%20selecting%20the%20for%20each%20loop%2C%20we%20need%20to%20give%20dynamic%20value%20to%20it%20and%20select%20the%20%E2%80%9Cbody%E2%80%9D%20parameter%20to%20it%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130263i10FAC6AF073F31A6%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2212.png%22%20title%3D%2212.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E10%20-%26nbsp%3BThen%20click%20on%20the%20%E2%80%9CAdd%20an%20action%E2%80%9D%20where%20we%20will%20be%20selecting%20the%20%E2%80%9CDelete%20Blob%E2%80%9D%20operation%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20909px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130264iD94A096ACA6730BD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2213.png%22%20title%3D%2213.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E12-%26nbsp%3BAfter%20this%2C%20we%20need%20to%20select%20the%20Blob%20Path%20which%20needs%20to%20be%20deleted%20and%20since%20it%20will%20be%20dynamic%2C%20we%20will%20choose%20the%20%E2%80%9CPath%E2%80%9D%20value%20for%20this%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130268i77B3757BE335B214%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2214.png%22%20title%3D%2214.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E13-%26nbsp%3B%20Now%20your%20Logic%20app%20designer%20should%20look%20like%20this%20and%20if%20yes%20then%20you%20can%20save%20the%20changes%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130270i460EA38227F6D437%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2215.png%22%20title%3D%2215.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E15%20-%26nbsp%3BRun%20it%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130273i0E0C1B89633310BA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2216.png%22%20title%3D%2216.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat's%20all%20guys.%20Happy%20Azure!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-838870%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20'inherit'%2Cserif%3B%20color%3A%20%23333333%3B%20background%3A%20white%3B%22%3EThis%20article%20is%20using%20the%20Logic%20app%20to%20create%20the%20simple%20and%20easy%20to%20use%20logic%20which%20can%20run%20in%20recurrence%20as%20per%20customer's%20need.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-838870%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Logic%20app%20with%20Azure%20Storage%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Storage%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

Prerequisites:

Blob Storage account which has the blobs inside which needs to be deleted:

1.png

 

 

Action:

1- Create the Logic App

2.png

2- As soon as you create the Logic app, you get to go to Designer part of it. Since we are creating the recurrence logic, we can start with inbuilt recurrence trigger:

3.png

 

3- Once you select the recurrence trigger, you get the screen where you can set the number of recurrences based on the need. As in below screen shot my logic will run once in every week:

4.png

 

4- After this you select the “New Step” where you get chance to select your blob storage. Search for Azure Blob Storage and select it:

5.png

 

5-After selecting the Blob storage, you have to select the action on that storage and we will select the list blobs operation since we will be listing the blobs first and then will perform further actions:

6.png

 

6-After this we need to select the Storage account where we need to list and delete the blobs and give connection name:

7.png

 

Click create button and then we need to select the container where our blobs reside and then click on new step:

8.png

 

7- Next step, we will create the Array where those blobs will be residing after fetching it. So, search for “Filter Array” keyword and select it:

9.png

 

8- After Array selection, we need to select the dynamic value which will be iterated from the array:

10.png

Then click on the “Edit in advanced mode” and provide this query “@less(item()?['LastModified'], addDays(utcNow(), -7))” which means that we will be checking the “LastModified” field and will filter which are later than 7 days from today( you can change this value as per your need).

17.png

 

9:Click on New Step and search for the “for each” for looping the array:

11.png

 

After selecting the for each loop, we need to give dynamic value to it and select the “body” parameter to it:

12.png

 

10 - Then click on the “Add an action” where we will be selecting the “Delete Blob” operation:

13.png

 

12- After this, we need to select the Blob Path which needs to be deleted and since it will be dynamic, we will choose the “Path” value for this:

14.png

 

13-  Now your Logic app designer should look like this and if yes then you can save the changes:

15.png

 

15 - Run it:

16.png

 

That's all guys. Happy Azure!