Logic App runs but it doesn't do the work

Adrian Iacob 20 Reputation points
2023-04-05T14:35:14.7433333+00:00

Hi community, I have built a Logic App that is supposed to delete entities from email. It works perfectly but it doesn't do the job. The documentation I followed is this: https://techcommunity.microsoft.com/t5/azure-paas-blog/managing-azure-table-storage-delete-table-entities-using-logic/ba-p/852748 The Logic App looks like this: User's image

The code for this Logic App is:

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json",
        "actions": {
            "For_each": {
                "actions": {
                    "Delete_Entity_(V2)": {
                        "inputs": {
                            "host": {
                                "connection": {
                                    "name": "@parameters('$connections')['azuretables']['connectionId']"
                                }
                            },
                            "method": "delete",
                            "path": "/v2/storageAccounts/@{encodeURIComponent(encodeURIComponent('AccountNameFromSettings'))}/tables/@{encodeURIComponent('Email')}/entities/etag(PartitionKey='@{encodeURIComponent(items('For_each')?['PartitionKey'])}',RowKey='@{encodeURIComponent(items('For_each')?['RowKey'])}')"
                        },
                        "runAfter": {},
                        "type": "ApiConnection"
                    }
                },
                "foreach": "@body('Get_entities_(V2)')?['value']",
                "runAfter": {
                    "Get_entities_(V2)": [
                        "Succeeded"
                    ]
                },
                "type": "Foreach"
            },
            "Get_entities_(V2)": {
                "inputs": {
                    "host": {
                        "connection": {
                            "name": "@parameters('$connections')['azuretables']['connectionId']"
                        }
                    },
                    "method": "get",
                    "path": "/v2/storageAccounts/@{encodeURIComponent(encodeURIComponent('AccountNameFromSettings'))}/tables/@{encodeURIComponent('Email')}/entities",
                    "queries": {
                        "$filter": "Timestamp le datetime'@{addDays(utcNow(), -30)}'"
                    }
                },
                "runAfter": {},
                "type": "ApiConnection"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "parameters": {
            "$connections": {
                "defaultValue": {},
                "type": "Object"
            }
        },
        "triggers": {
            "Recurrence": {
                "evaluatedRecurrence": {
                    "frequency": "Day",
                    "interval": 1
                },
                "recurrence": {
                    "frequency": "Day",
                    "interval": 1
                },
                "type": "Recurrence"
            }
        }
    },
    "parameters": {
        "$connections": {
            "value": {
                "azuretables": {
                    "connectionId": "/subscriptions/d6ebdb28-953f-4c59-9f08-8864666c3a84/resourceGroups/PZI-GXEU-N-RGP-KLNXX-D002/providers/Microsoft.Web/connections/azuretables",
                    "connectionName": "azuretables",
                    "id": "/subscriptions/d6ebdb28-953f-4c59-9f08-8864666c3a84/providers/Microsoft.Web/locations/westeurope/managedApis/azuretables"
                }
            }
        }
    }
}

This is from the Run History: User's image

And this is my Email Table which should be deleted: User's image

Any clue why it does not delete the emails?

Thank you in advance!

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Dillon Silzer 57,826 Reputation points Volunteer Moderator
    2023-04-05T15:28:02.23+00:00

    Hi Adrian,

    When you check its runs, you should be able to see its run history and the steps performed. Perhaps check the logs and see what commands it is issuing.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.