

Azure Logic Apps: Automating Blob Storage with Azure
Azure Logic Apps is part of Azure Integration PaaS, a suite of Azure-managed services for Enterprise Application Integration (EAI) and workflows. It offers a low-code / no-code paradigm for creating massively scalable integration systems with pay-as-you-go pricing.
Azure Logic Apps assists in creating and designing automated workflows that are capable of integrating services, systems, and applications. Azure Logic Apps is especially useful for use cases and scenarios where you need to coordinate actions across multiple systems and services. It helps automate repetitive tasks and orchestrate workflows on multiple services, saving time and reducing mundane tasks.
Use Cases:
- SaaS Product Integration: Seamlessly connect and automate workflows between multiple SaaS applications.
- Scheduled Tasks: Automate routine tasks by setting up time-based triggers for execution.
- Data Integration and Transformation: Consolidates data from various sources, transform it, and send it to a central data repository.
- Incident Management and Alerts: Monitor systems for incidents and automate alerts and responses for quick resolution.
Benefits:
- Scalability and Flexibility: Logic Apps allow businesses to scale up or down according to their needs. The platform is highly flexible and can adjust according to workloads, helping users optimize costs and resources. There’s no need to provision or manage servers or infrastructure, as Azure handles these details.
- Integration and Connectivity: Azure Logic Apps comes equipped with many connectors for various services, including both Microsoft and non-Microsoft offerings, thus enabling users to create workflows that align with their business needs.
- Rapid Development and Deployment: Azure Logic Apps can help businesses reduce the time it takes to develop and deploy applications. The service’s user-friendly interface and pre-built templates are one of the Azure functions, making the development of workflows a quicker, more streamlined process.
- Monitoring and Analytics: With azure logic apps, users can monitor the status and performance of workflows, access execution history, and analyze logs, giving users a visibility of workflow behavior.
Overview: This blog explores automating blob storage management using Azure Logic Apps, a powerful component of Azure's Integration Platform as a Service (PaaS). By leveraging a low-code/no-code approach, users can create scalable integration solutions that efficiently manage storage costs. A key use case involves automatically moving blobs from hot to cold storage containers based on their last modified date. This proactive strategy helps organizations reduce storage expenses while ensuring that infrequently accessed data is retained securely.
Prerequisites:
- Create an Azure Account If you don’t already have an Azure account, sign up at Microsoft Azure.
- Concept of Azure Blob Storage account
Step-by-Step Guide:
Step 1: Create Storage Account.
Within storage account, create two Containers, test(in hot tier) and est(in cold tier).

In the container test, a blob is uploaded.

And the container est is left empty.

Step 2: Create Logic App
Now, create a Logic App that monitors the Blog Storage. Based on the blob's last modified date, blobs are automatically moved from one container to another.

Step 3: Create Logic App Workflow
Within Logic App, click on Logic App Designer to create a required workflow.

Once you are in the designer view, you will need to set a trigger as the first step.

Add a trigger
- Under Triggers, select the Recurrence. We configure it to run the logic app every week at the specified time (add parameter Start Time).

Once we select the trigger and have set up the connection, we will define the location where we want to check for new files.
Add an actions
- The next move is to list all blobs in a container. So, we add List blobs (V2) as a action.
Configure Blob Storage Connection: To use the blob action, we must create a storage connection.
- Provide a connection name.
- Choose the Authentication type as an Access key.
- Provide the name of the Azure Storage Account.
- Provide Access Key of Storage Account.

Access key to the storage account can be found in your previously created Storage Account resource.

- Once the connection is created, set up your List Blob(V2) action as follows
folder: path to your blob

- The next thing we need to do is to set up the for loop that will iterate through all of the blobs in the container, extract their Last Modified Date, and upload it to the cold tier, i.e., if files are not used regularly, they are passed to the cold tier which minimizes the cost of storage.You can use
for each
to traverse your blobs:

- Inside the For each loop, create Condition action to compare its time.
Each listed blob's age has to be checked. We need to add a condition to check how old the blob is before moving it to the required folder.
If the Last Modified Date of the blob is greater than 30 days, we move it to another container.

addDays expression:
addDays(utcNow('yyyy-MM-ddTHH:mm:ss'),-30,'yyyy-MM-ddTHH:mm:ss')
- If this condition is true, i.e., if the file was last modified before 30 days, we copy the blob to another container.

- And delete the blob from the existing container.

Step 4: Save and Run the Logic App
Logic App workflow:

Successfully running workflow:

In conclusion, Azure Logic Apps provide a robust framework for automating blob storage management, enabling organizations to minimize costs while efficiently managing their data lifecycle. Businesses can significantly streamline their storage operations by implementing a Logic App workflow that monitors and moves blobs based on their last modified dates. This approach reduces expenses associated with hot storage and simplifies data governance practices.\