0

Good afternoon everyone,

I'm trying to create a simple Logic App, but for some reason that I can't understand, I am unable to save it. The Logic App is straightforward, it should only post a message on Slack when an Azure Blob Storage trigger is executed. However, there is something wrong, and it won't let me save the application.

Here's the code:

{
  "definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
  "Publicar_mensaje_(v2)": {
    "type": "ApiConnection",
    "inputs": {
      "host": {
        "connection": {
          "referenceName": "slack"
        }
      },
      "method": "post",
      "body": {
        "channel": "C04MV4K08TW",
        "text": "Test from Azure Logic App :::{hidden}:::"
      },
      "path": "/v2/chat.postMessage"
    },
    "runAfter": {},
    "trackedProperties": {}
  }
},
"contentVersion": "1.0.0.0",
"outputs": {},
"triggers": {
  "When_a_blob_is_added_or_updated": {
    "type": "ServiceProvider",
    "inputs": {
      "parameters": {
        "path": "configurationscontainer/configurations_mock.json"
      },
      "serviceProviderConfiguration": {
        "connectionName": "AzureBlob-2",
        "operationId": "whenABlobIsAddedOrModified",
        "serviceProviderId": "/serviceProviders/AzureBlob"
      }
    },
    "conditions": [],
    "trackedProperties": {
      "key": "connectionvalue"
    }
  }
}
 },
"connectionReferences": {
"AzureBlob-2": {
  "api": {
    "id": "/serviceProviders/AzureBlob"
  },
  "connection": {
    "id": "/serviceProviders/AzureBlob/connections/AzureBlob-2"
  },
  "connectionName": "AzureBlob-2",
  "authentication": {
    "type": "ManagedServiceIdentity"
  }
},
"slack": {
  "api": {
    "id": "/subscriptions/{hidden_id}/providers/Microsoft.Web/locations/westeurope/managedApis/slack"
  },
  "connection": {
    "id": "/subscriptions/{hidden_id}/resourceGroups/{hidden}/providers/Microsoft.Web/connections/slack"
  },
  "connectionName": "slack",
  "authentication": {
    "type": "ManagedServiceIdentity"
  }
}
},
"parameters": {}
}

Here's an image from the error (I can't copy the text):

enter image description here

I would really appreciate any possible help, it's the first Logic App I'm developing and I'm starting to feel quite desperate. :-(

PD. Before asking I obviously did a lot of research but...no such luck.

Thanks in advance to everybody.

MadDev
  • 113
  • 16

2 Answers2

2

I have reproduced in my environment and I got expected results as below:

Design:

Have used v2 version of trigger here:

enter image description here

Entered Slack Creds:

enter image description here

Output:

When added a blob in Storage Account:

enter image description here

Logic app gets triggered and send message:

enter image description here

enter image description here

enter image description here

In slack:

enter image description here

Message is :

enter image description here

Code view:

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Post_message_(V2)": {
                "inputs": {
                    "body": {
                        "channel": "C05GUBE8BJA",
                        "text": "Hello Rithwik, Sent from Logic app, You have a NEW BLOB ADDED !!!"
                    },
                    "host": {
                        "connection": {
                            "name": "@parameters('$connections')['slack']['connectionId']"
                        }
                    },
                    "method": "post",
                    "path": "/v2/chat.postMessage"
                },
                "runAfter": {},
                "type": "ApiConnection"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "parameters": {
            "$connections": {
                "defaultValue": {},
                "type": "Object"
            }
        },
        "triggers": {
            "When_a_blob_is_added_or_modified_(properties_only)_(V2)": {
                "evaluatedRecurrence": {
                    "frequency": "Second",
                    "interval": 1
                },
                "inputs": {
                    "host": {
                        "connection": {
                            "name": "@parameters('$connections')['azureblob']['connectionId']"
                        }
                    },
                    "method": "get",
                    "path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('AccountNameFromSettings'))}/triggers/batch/onupdatedfile",
                    "queries": {
                        "checkBothCreatedAndModifiedDateTime": false,
                        "folderId": "JTJmcml0aHdpaw==",
                        "maxFileCount": 10
                    }
                },
                "metadata": {
                    "JTJmcml0aHdpaw==": "/rithwik"
                },
                "recurrence": {
                    "frequency": "Second",
                    "interval": 1
                },
                "splitOn": "@triggerBody()",
                "type": "ApiConnection"
            }
        }
    },
    "parameters": {
        "$connections": {
            "value": {
                "azureblob": {
                    "connectionId": "/subscriptions/b83c1ed3/resourceGroups/vrbojja/providers/Microsoft.Web/connections/azureblob",
                    "connectionName": "azureblob",
                    "id": "/subscriptions/b83c1ed3/providers/Microsoft.Web/locations/eastus/managedApis/azureblob"
                },
                "slack": {
                    "connectionId": "/subscriptions/b83c1ed3/resourceGroups/v-rbojja/providers/Microsoft.Web/connections/slack",
                    "connectionName": "slack",
                    "id": "/subscriptions/b83c1ed3/providers/Microsoft.Web/locations/eastus/managedApis/slack"
                }
            }
        }
    }
}

Try to follow above design or code and you will get output as I have got and if still no success, I would suggest you to raise a support request.

RithwikBojja
  • 5,069
  • 2
  • 3
  • 7
0

Thanks a lot RithwikBojja!!! I think that mi problem is the Trigger conditions is empty, but I don' know what I should to set in this field. :-(

enter image description here

I know, I know.... this is not exactly an answer,

If you know how I can set this condition I really apreciate it.

Otherwise... Thanks A Lot!

MadDev
  • 113
  • 16