I am using the following ARM-template to make a Logic App that posts a message to Slack. However, when it gets deployed I get a Post-message "connection not found" (see image).
What is wrong with the template causing me to get connection not found?
{
"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"parameters":{
"slack":{
"defaultValue":"",
"type":"Object"
}
},
"triggers":{
"manual":{
"inputs":{
"schema":{
"$schema":"http://json-schema.org/draft-04/schema#",
"properties":{
"context":{
"properties":{
"name":{
"type":"string"
},
"portalLink":{
"type":"string"
},
"resourceName":{
"type":"string"
}
},
"required":[
"name",
"portalLink",
"resourceName"
],
"type":"object"
},
"status":{
"type":"string"
}
},
"required":[
"status",
"context"
],
"type":"object"
}
},
"kind":"Http",
"type":"Request"
}
},
"actions":{
"Post_message":{
"runAfter":{
},
"type":"ApiConnection",
"inputs":{
"host":{
"connection":{
"name":"Hard-coded name here"
}
},
"method":"post",
"path":"/chat.postMessage",
"queries":{
"channel":"slack-channel-name",
"text":"This is a test :) "
}
}
}
},
"outputs":{
}
}
I am adding the parameters with a Python workflow-package in a separate script, imported from:
azure.mgmt.logic.models import Workflow
This seems to be working ok as the Logic App gets deployed just fine, it is only the connection that is missing.
This is occurring, because you have not created a Slack connector
and added it's details in the Logic App. The Logic App ARM for this shall look something like:
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Post_message": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['slack']['connectionId']"
}
},
"method": "post",
"path": "/chat.postMessage",
"queries": {
"channel": "C0N******UT",
"text": "Hello there!"
}
},
"runAfter": {},
"type": "ApiConnection"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"manual": {
"inputs": {
"schema": {}
},
"kind": "Http",
"type": "Request"
}
}
},
"parameters": {
"$connections": {
"value": {
"slack": {
"connectionId": "/subscriptions/b8*******23f/resourceGroups/RG_NAME/providers/Microsoft.Web/connections/slack",
"connectionName": "slack",
"id": "/subscriptions/b83c1ed************4c23f/providers/Microsoft.Web/locations/westus2/managedApis/slack"
}
}
}
}
}
The slack connector should be added here:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.