Delete all the Azure Storage Blob content before N days using Logic App

Published Sep 05 2019 06:30 AM 4,296 Views
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!

8 Comments
%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%20image-alt%3D%221.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130246iD9B0E85AB3A2179D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%221.png%22%20alt%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%20image-alt%3D%222.png%22%20style%3D%22width%3A%20454px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130248i27162C72381A10E2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222.png%22%20alt%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%20image-alt%3D%223.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130249i72F9B23ACE5255DF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%223.png%22%20alt%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%20image-alt%3D%224.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130250iD67B24B127F2288C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%224.png%22%20alt%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%20image-alt%3D%225.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130251i83B8DA00AFFA7FDB%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%225.png%22%20alt%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%20image-alt%3D%226.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130252i5B849C02E27A4742%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%226.png%22%20alt%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%20image-alt%3D%227.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130253iA4442F495D0D68B9%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%227.png%22%20alt%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%20image-alt%3D%228.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130254i82AC89A38E856236%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%228.png%22%20alt%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%20image-alt%3D%229.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130256i47881E335E155E0A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%229.png%22%20alt%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%20image-alt%3D%2210.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130260iBDAC6D55246FAB9E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2210.png%22%20alt%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%20image-alt%3D%2217.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130261i02D80396485D11B6%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2217.png%22%20alt%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%20image-alt%3D%2211.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130262i09797D68E3B3B053%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2211.png%22%20alt%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%20image-alt%3D%2212.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130263i10FAC6AF073F31A6%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2212.png%22%20alt%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%20image-alt%3D%2213.png%22%20style%3D%22width%3A%20909px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130264iD94A096ACA6730BD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2213.png%22%20alt%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%20image-alt%3D%2214.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130268i77B3757BE335B214%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2214.png%22%20alt%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%20image-alt%3D%2215.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130270i460EA38227F6D437%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2215.png%22%20alt%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%20image-alt%3D%2216.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130273i0E0C1B89633310BA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2216.png%22%20alt%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%3CLINGO-SUB%20id%3D%22lingo-sub-2204374%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20all%20the%20Azure%20Storage%20Blob%20content%20before%20N%20days%20using%20Logic%20App%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2204374%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20Manish.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20can%20we%20manage%20the%20Logic%20App%20to%20run%20when%20there%20are%20more%20than%205000%20blobs%3F%3C%2FP%3E%3CP%3EI%20saw%20there%20is%20a%20limit%20of%205000%20per%20execution.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2253490%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20all%20the%20Azure%20Storage%20Blob%20content%20before%20N%20days%20using%20Logic%20App%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2253490%22%20slang%3D%22en-US%22%3E%3CP%3EHELP!%26nbsp%3B%20I%20added%20this%20so%20I%20could%20remove%20files%20older%20than%2030%20days%20and%20it%20delete%20ALL%20FILES%20in%20the%20container!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E(Starts%20with%20the%20ampersand%20but%20I%20can't%20post%20the%20message%20with%20it%20in%20there)%3C%2FP%3E%3CP%3Eless(item()%3F%5B'LastModified'%5D%2C%20addDays(utcNow()%2C%20-30)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20did%20I%20do%20wrong%3F%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Logic%20Apps%20Designer%20-%20CleanUpSaasBackups.png%22%20style%3D%22width%3A%20719px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F269433iA90CA1268FC6722E%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Logic%20Apps%20Designer%20-%20CleanUpSaasBackups.png%22%20alt%3D%22Logic%20Apps%20Designer%20-%20CleanUpSaasBackups.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2253493%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20all%20the%20Azure%20Storage%20Blob%20content%20before%20N%20days%20using%20Logic%20App%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2253493%22%20slang%3D%22en-US%22%3E%3CP%3EPlease%20disregard%20previous%20message.%20While%20creating%20this%20the%20designer%20told%20me%20it%20had%20create%20a%20For%20Each%20and%20I%20thought%20it%20meant%20for%20each%20Blob%20Container%20so%20I%20accepted%20it%20but%20it%20did%20something%20else%20(See%20For%20each%202%20inside%20loop%3F).%20I%20removed%20that%20and%20I%20think%20it's%20working%20now.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20how%20would%20I%20do%20this%20for%20each%20container%20in%20the%20same%20storage%20account%3F%20I%20have%20about%2050%20different%20containers%20that%20I%20want%20to%20keep%20clean.%20And%20there%20are%20certain%20ones%20I%20want%20to%20skip.%20I%20can't%20find%20a%20way%20to%20List%20all%20Blob%20containers%20in%20a%20storage%20account.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2253573%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20all%20the%20Azure%20Storage%20Blob%20content%20before%20N%20days%20using%20Logic%20App%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2253573%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F995034%22%20target%3D%22_blank%22%3E%40faldana%3C%2FA%3E%26nbsp%3BI%20think%20you%20will%20get%20the%20nextmarker%20value%20in%20response%20if%20you%20have%20more%20than%205000%20blobs.%20you%20can%20pass%20this%20value%20again%20with%20list%20blob%20until%20you%20stop%20getting%20that%20parameter.%20That's%20one%20way%20to%20deal%20with%20that.%20That%3Bs%20how%20even%20SDK%20works%20in%20the%20background.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESecond%20and%20easy%20way%20is%20to%20use%20the%20Life%20cycle%20management%20policy%20which%20is%20inbuilt%20in%20Azure%20portal%20and%20you%20can%20achieve%20the%20same%20there%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fstorage%2Fblobs%2Fstorage-lifecycle-management-concepts%3Ftabs%3Dazure-portal%23add-or-remove-a-policy%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fstorage%2Fblobs%2Fstorage-lifecycle-management-concepts%3Ftabs%3Dazure-portal%23add-or-remove-a-policy%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2253575%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20all%20the%20Azure%20Storage%20Blob%20content%20before%20N%20days%20using%20Logic%20App%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2253575%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F242707%22%20target%3D%22_blank%22%3E%40Michael%20Rybicki%3C%2FA%3E%26nbsp%3Byou%20can%20use%20the%20%22List%20Blobs%20in%20root%20folder%22%20option%20which%20will%20fetch%20you%20all%20the%20containers%20and%20you%20can%20loop%20them%20all%20to%20achieve%20what%20you%20want.%20Again%20that's%20one%20way%20of%20doing%20it.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22manish_gupta_0-1617596217186.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F269436i60DEE3F1CEC8ADB6%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22manish_gupta_0-1617596217186.png%22%20alt%3D%22manish_gupta_0-1617596217186.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESecond%20and%20easy%20way%20would%20be%20to%20use%20the%20Life%20cycle%20management%20which%20you%20can%20use%20directly%20from%20Azure%20portal%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fstorage%2Fblobs%2Fstorage-lifecycle-management-concepts%3Ftabs%3Dazure-portal%23add-or-remove-a-policy%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fstorage%2Fblobs%2Fstorage-lifecycle-management-concepts%3Ftabs%3Dazure-portal%23add-or-remove-a-policy%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2254981%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20all%20the%20Azure%20Storage%20Blob%20content%20before%20N%20days%20using%20Logic%20App%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2254981%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20Manish.%3C%2FP%3E%3CP%3EYep.%20I%20got%20this%20using%20the%20Life%20Cycle%20Management%2C%20and%20it%20is%20working%20perfectly%20for%20about%2020%20days.%3C%2FP%3E%3CP%3EThanks%20so%20much%20for%20answering%20my%20question.%3C%2FP%3E%3CP%3ERegards.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2257230%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20all%20the%20Azure%20Storage%20Blob%20content%20before%20N%20days%20using%20Logic%20App%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2257230%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403862%22%20target%3D%22_blank%22%3E%40manish_gupta%3C%2FA%3E%26nbsp%3B-%20I%20will%20try%20to%20cycle%20through%20the%20containers.%20Unfortunately%20Lifecycle%20Management%20doesn't%20work%20for%20me%20because%20these%20are%20all%20Page%20Blobs%20(SQL%20Server%20backups)%20and%20Lifecycle%20management%20doesn't%20auto-archive%20those.%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fhtml%2F%40FE3C8A5543DEF164D4C09E9B7F45E1A4%2Fimages%2Femoticons%2Ffacepalm_40x40.gif%22%20alt%3D%22%3Afacepalm%3A%22%20title%3D%22%3Afacepalm%3A%22%20%2F%3E%26nbsp%3B%20Maybe%20you%20can%20put%20in%20a%20good%20word%20for%20me%20so%20they%20will%20start%20allowing%20that.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Version history
Last update:
‎Sep 15 2020 06:07 AM
Updated by: