Logic App 触发器用于 Azure Blob 存储不起作用。

huangapple go评论78阅读模式
英文:

Logic Appp trigger for Azure Blob Storeage is not working

问题

下午好,大家,

我试图创建一个简单的逻辑应用,但出于某种我无法理解的原因,我无法保存它。这个逻辑应用很简单,它只应该在执行 Azure Blob 存储触发器时在 Slack 上发布一条消息。然而,有些地方出了问题,它不允许我保存应用程序。

以下是代码:

{
  "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": "来自 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": {}
}

这是错误的图像(我无法复制文本):

Logic App 触发器用于 Azure Blob 存储不起作用。

我真的非常感谢任何可能的帮助,这是我开发的第一个逻辑应用,我开始感到非常绝望。:-(

附言:在提问之前,我显然进行了大量的研究,但是...没有运气。

非常感谢提前给所有人。

英文:

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):

Logic App 触发器用于 Azure Blob 存储不起作用。

I would really appreciate any possible help, it's the first Logic App I'm developing and I'm starting to feel quite desperate. Logic App 触发器用于 Azure Blob 存储不起作用。

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

Thanks in advance to everybody.

答案1

得分: 2

我在我的环境中复现了,得到了如下预期的结果:

设计:

在这里使用了触发器的v2版本:

Logic App 触发器用于 Azure Blob 存储不起作用。

输入了Slack凭据:

Logic App 触发器用于 Azure Blob 存储不起作用。

输出:

当在存储帐户中添加了一个Blob时:

Logic App 触发器用于 Azure Blob 存储不起作用。

逻辑应用被触发并发送消息:

Logic App 触发器用于 Azure Blob 存储不起作用。

Logic App 触发器用于 Azure Blob 存储不起作用。

Logic App 触发器用于 Azure Blob 存储不起作用。

在Slack中:

Logic App 触发器用于 Azure Blob 存储不起作用。

消息是:

Logic App 触发器用于 Azure Blob 存储不起作用。

代码视图:

{
    "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"
                }
            }
        }
    }
}

尝试按照上述的设计或代码进行操作,你将会得到与我所得到的输出相同的结果。如果仍然没有成功,我建议你提出一个支持请求。

英文:

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

Design:

Have used v2 version of trigger here:

Logic App 触发器用于 Azure Blob 存储不起作用。

Entered Slack Creds:

Logic App 触发器用于 Azure Blob 存储不起作用。

Output:

When added a blob in Storage Account:

Logic App 触发器用于 Azure Blob 存储不起作用。

Logic app gets triggered and send message:

Logic App 触发器用于 Azure Blob 存储不起作用。

Logic App 触发器用于 Azure Blob 存储不起作用。

Logic App 触发器用于 Azure Blob 存储不起作用。

In slack:

Logic App 触发器用于 Azure Blob 存储不起作用。

Message is :

Logic App 触发器用于 Azure Blob 存储不起作用。

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.

答案2

得分: 0

非常感谢RithwikBojja!我认为我的问题在于触发条件为空,但我不知道应该在这个字段中设置什么。 Logic App 触发器用于 Azure Blob 存储不起作用。

Logic App 触发器用于 Azure Blob 存储不起作用。

我知道,我知道...这并不完全是一个答案,

如果你知道我如何设置这个条件,我真的很感激。

否则...非常感谢!

英文:

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. Logic App 触发器用于 Azure Blob 存储不起作用。

Logic App 触发器用于 Azure Blob 存储不起作用。

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!

huangapple
  • 本文由 发表于 2023年7月13日 21:06:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/76679714.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定