英文:
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": {}
}
这是错误的图像(我无法复制文本):
我真的非常感谢任何可能的帮助,这是我开发的第一个逻辑应用,我开始感到非常绝望。:-(
附言:在提问之前,我显然进行了大量的研究,但是...没有运气。
非常感谢提前给所有人。
英文:
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):
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.
答案1
得分: 2
我在我的环境中复现了,得到了如下预期的结果:
设计:
在这里使用了触发器的v2版本:
输入了Slack凭据:
输出:
当在存储帐户中添加了一个Blob时:
逻辑应用被触发并发送消息:
在Slack中:
消息是:
代码视图:
{
"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:
Entered Slack Creds:
Output:
When added a blob in Storage Account:
Logic app gets triggered and send message:
In slack:
Message is :
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!我认为我的问题在于触发条件为空,但我不知道应该在这个字段中设置什么。
我知道,我知道...这并不完全是一个答案,
如果你知道我如何设置这个条件,我真的很感激。
否则...非常感谢!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论