Azure Storage Account Duplicate File Deletion: Serverless Solution Recommendation

Automated Duplicate File Detection and Deletion for Azure Storage Account

Question

You have an Azure subscription that contains a storage account.

An application sometimes writes duplicate files to the storage account.

You have a PowerShell script that identifies and deletes duplicate files in the storage account. Currently, the script is run manually after approval from the operations manager.

You need to recommend a serverless solution that performs the following actions:

-> Runs the script once an hour to identify whether duplicate files exist

-> Sends an email notification to the operations manager requesting approval to delete the duplicate files

-> Processes an email response from the operations manager specifying whether the deletion was approved

-> Runs the script if the deletion was approved

What should you include in the recommendation?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

B

You can schedule a powershell script with Azure Logic Apps.

When you want to run code that performs a specific job in your logic apps, you can create your own function by using Azure Functions. This service helps you create Node.js, C#, and F# functions so you don't have to build a complete app or infrastructure to run code. You can also call logic apps from inside Azure functions.

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-azure-functions

To meet the requirements of this scenario, you need to recommend a serverless solution that can automate the detection and deletion of duplicate files from an Azure storage account. The solution should also provide email notification to the operations manager, seeking approval to delete the duplicate files and then process the email response to execute the deletion if the approval is granted.

Out of the given options, the most suitable recommendation is Azure Logic Apps and Azure Functions. Let's understand why:

Azure Logic Apps is a cloud-based service that enables you to develop workflows to integrate different systems, services, and applications. It provides a visual designer to create workflows using connectors that integrate with different services such as Azure Storage, Office 365, and more.

Azure Functions is a serverless compute service that enables you to run event-triggered code without worrying about infrastructure management. It supports various languages such as C#, Java, and Python, and can be triggered by various events, including HTTP requests, Azure Storage events, and more.

Using Azure Logic Apps and Azure Functions together, you can create a solution that automates the detection and deletion of duplicate files from an Azure storage account, as well as manage the approval process. Here's how:

  1. Create a Logic App that runs once an hour using the Recurrence trigger. Add an action to call an Azure Function that identifies whether duplicate files exist in the storage account. The Azure Function can be written in your preferred language and should use the Azure Storage SDK to interact with the storage account.

  2. If the Azure Function identifies duplicate files, add an action to send an email notification to the operations manager requesting approval to delete the duplicate files. You can use the Office 365 Outlook connector to send the email.

  3. Create a second Logic App that listens for incoming emails using the Office 365 Outlook trigger. Add an action to parse the email response from the operations manager, which should specify whether the deletion was approved or not.

  4. If the deletion was approved, add an action to call the Azure Function again to execute the deletion of the duplicate files.

  5. If the deletion was not approved, you can send an email notification to the relevant parties informing them of the decision.

In summary, using Azure Logic Apps and Azure Functions, you can create an end-to-end solution that automates the detection and deletion of duplicate files from an Azure storage account, as well as manage the approval process. This approach leverages the strengths of both services to provide a highly flexible, scalable, and resilient solution that is ideal for serverless architectures.