Go to Azure portal : Azure
You will see window like below
Click on "Create a resource"
Now new window will come like below, select create > Logic App
Now new window will come like below
Enter the resource group, logic app name, select the region, select the plan type as consumption
Now click next > Next, you will see a window like below
Deployment will take some time, now go to the resource
The moment you will go to resource, Logic app designer will be opened automatically like below
Go downwards and click on 'Blank logic app'
Search for appropriate triggers, in my case I will be searching for "Recurrence"
Select the icon shown below
Set in the parameters acc to your need, I will be setting Once a day
Now click on Next step, a window will open like below, where you can select actions
Now you may rename the action as well, as shown below
Now add an action and 'SFTP' and select 'List files in folder', as shown below
In my case I have already setup the SFP connection, but you can also setup like below
Fill in the connection name, host server address, username and password (click on disable SSH host key validation) if you are using username and password
Now save the connection and make it as default
Now click on the Folder, a lookup will come like below
Now click on, New step and search for 'For each' in control
Now select an action inside the loop, now search for condition and select like shown below
Now the copy file action should look like below
the 1st expression in the Destination file path is utcNow('yyyy')
and the 2nd expression in the Destination file path is utcNow('MM')
Now below that action add an action 'Delete file' as shown below
Now configure the Delete file action like below
Tada!!!