Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d68fb56
Enable Teams chatbot image input through connector downloads
JialinHuang803 Oct 29, 2026
9364068
Merge latest main into Teams image recognition branch
JialinHuang803 Oct 29, 2026
f2a71dc
Merge latest main into Teams image recognition branch
JialinHuang803 Oct 29, 2026
467588d
Fix secured Teams image forwarding through direct action outputs
JialinHuang803 Oct 29, 2026
c047b07
Group Teams image resolution into parallel secured download branches
JialinHuang803 Oct 29, 2026
13163be
Fix Teams activity body forwarding and expose workflow failures
JialinHuang803 Oct 29, 2026
1ebc687
Disable unsupported Logic Apps chunked uploads to Teams bot
JialinHuang803 Oct 29, 2026
58992be
Simplify Teams image downloads with a protected sequential array
JialinHuang803 Oct 30, 2026
27c5270
Remove redundant prepared activity validation
JialinHuang803 Oct 30, 2026
2ea82b0
Bypass image resolution for Teams messages without images
JialinHuang803 Oct 30, 2026
66a61b7
Clarify stored image filtering and remove per-message image log
JialinHuang803 Nov 2, 2026
fd2ef49
Inline Teams message JSON parser configuration
JialinHuang803 Nov 2, 2026
0685070
Consolidate Teams bot image tests and update channel manifest
JialinHuang803 Nov 2, 2026
8c2eabd
Simplify Teams image handling after backend review
JialinHuang803 Nov 2, 2026
2b5b084
Update Teams bot image tags for all environments
JialinHuang803 Nov 2, 2026
0c06e6b
Merge latest main into Teams image recognition
JialinHuang803 Nov 2, 2026
63abb34
Remove Teams image README additions
JialinHuang803 Nov 5, 2026
d6b9af2
Handle image preparation failures and clarify image limits
JialinHuang803 Nov 5, 2026
536ea14
Separate bot invocation from image resolution scope
JialinHuang803 Nov 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@
"$connections": {
"defaultValue": {},
"type": "Object"
},
"maxImageBytes": {
"defaultValue": 5242880,
"type": "Int"
}
},
"triggers": {
Expand All @@ -126,10 +130,28 @@
},
"outputs": {},
"actions": {
"Initialize_downloaded_images": {
"type": "InitializeVariable",
"inputs": {
"variables": [
{
"name": "downloadedImages",
"type": "array",
"value": []
}
]
},
"runAfter": {}
},
"For_each": {
"type": "Foreach",
"foreach": "@triggerBody()?['value']",
"runAfter": {},
"operationOptions": "Sequential",
"runAfter": {
"Initialize_downloaded_images": [
"Succeeded"
]
},
"actions": {
"Get_and_resolve_message_details": {
"type": "Scope",
Expand Down Expand Up @@ -446,14 +468,149 @@
"uri": "[concat(parameters('serverBaseUrl'), '/activity/convert')]"
}
},
"Scope": {
"type": "Scope",
"Filter_image_attachments": {
"type": "Query",
"inputs": {
"from": "@coalesce(body('convertActivity')?['attachments'], json('[]'))",
"where": "@startsWith(coalesce(item()?['contentType'], ''), 'image/')"
},
"runAfter": {
"convertActivity": [
"Succeeded"
]
}
},
"Has_image_attachments": {
"type": "If",
"expression": "@greater(length(body('Filter_image_attachments')), 0)",
"runAfter": {
"Filter_image_attachments": [
"Succeeded"
]
},
"actions": {
"Resolve_image_bytes": {
"type": "Scope",
"runAfter": {},
"actions": {
"Reset_downloaded_images": {
"type": "SetVariable",
"inputs": {
"name": "downloadedImages",
"value": []
},
"runAfter": {}
},
"Filter_graph_hosted_images": {
"type": "Query",
"inputs": {
"from": "@take(body('Filter_image_attachments'), 4)",
"where": "@and(startsWith(coalesce(item()?['contentUrl'], ''), 'https://graph.microsoft.com/'), contains(coalesce(item()?['contentUrl'], ''), '/hostedContents/'), endsWith(coalesce(item()?['contentUrl'], ''), '/$value'))"
},
"runAfter": {
"Reset_downloaded_images": [
"Succeeded"
]
}
},
"Download_graph_images": {
"type": "Foreach",
"foreach": "@body('Filter_graph_hosted_images')",
"operationOptions": "Sequential",
"actions": {
"Download_Graph_image": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['teams']['connectionId']"
}
},
"method": "post",
"path": "/httprequest",
"headers": {
"Uri": "@items('Download_graph_images')['contentUrl']",
"Method": "GET",
"Content-Type": "application/json"
},
"retryPolicy": {
"type": "none"
}
},
"runtimeConfiguration": {
"secureData": {
"properties": [
"outputs"
]
}
}
},
"Append_downloaded_image": {
"type": "AppendToArrayVariable",
"inputs": {
"name": "downloadedImages",
"value": {
"url": "@items('Download_graph_images')['contentUrl']",
"body": "@if(lessOrEquals(length(coalesce(body('Download_Graph_image')?['$content'], '')), mul(4, div(add(parameters('maxImageBytes'), 2), 3))), body('Download_Graph_image'), null)"
}
},
"runAfter": {
"Download_Graph_image": [
"Succeeded"
]
}
}
},
"runAfter": {
"Filter_graph_hosted_images": [
"Succeeded"
]
}
},
"Image_download_results": {
"type": "Compose",
"inputs": "@variables('downloadedImages')",
"runAfter": {
"Download_graph_images": [
"Succeeded",
"Failed",
"TimedOut"
]
},
"runtimeConfiguration": {
"secureData": {
"properties": [
"inputs"
]
}
}
},
"Prepare_activity_images": {
"type": "JavaScriptCode",
"inputs": {
"code": "var activity=workflowContext.actions.convertActivity.outputs.body;\nvar results=workflowContext.actions.Image_download_results.outputs,images={};\nfor(var i=0;i<results.length;i++){\n var image=results[i];\n if(!image||image.body===null)continue;\n var b=image.body;\n if(!image.url||!b||typeof b['$content']!=='string'||typeof b['$content-type']!=='string')throw new Error('Invalid Teams image body');\n images[image.url]='data:'+b['$content-type'].split(';')[0].trim().toLowerCase()+';base64,'+b['$content'];\n}\nactivity.attachments=(activity.attachments||[]).map(function(a){\n return images[a.contentUrl]?Object.assign({},a,{contentUrl:images[a.contentUrl]}):a;\n});\nreturn activity;",
"explicitDependencies": {
"actions": [
"convertActivity",
"Image_download_results"
]
}
},
"runAfter": {
"Image_download_results": [
"Succeeded"
]
},
"runtimeConfiguration": {
"secureData": {
"properties": [
"outputs"
]
}
}
}
}
},
"Invoke_QA_Bot": {
"type": "Http",
"inputs": {
Expand All @@ -462,7 +619,7 @@
"identity": "[parameters('botIdentityResourceId')]",
"type": "ManagedServiceIdentity"
},
"body": "@json(string(body('convertActivity')))",
"body": "@if(equals(actions('Prepare_activity_images')?['status'], 'Succeeded'), body('Prepare_activity_images'), body('convertActivity'))",
"headers": {
"Content-Type": "application/json"
},
Expand All @@ -472,21 +629,51 @@
},
"uri": "[concat(parameters('botBaseUrl'), '/api/messages')]"
},
"runtimeConfiguration": {
"contentTransfer": {
"transferMode": "Chunked"
}
}
},
"Compose": {
"type": "Compose",
"inputs": "@outputs('Invoke_QA_Bot')?['statusCode']",
"runAfter": {
"Invoke_QA_Bot": [
"Resolve_image_bytes": [
"Succeeded",
"Failed",
"TimedOut",
"Failed"
"Skipped"
]
},
"runtimeConfiguration": {
"secureData": {
"properties": [
"inputs"
]
}
}
}
},
"else": {
"actions": {
"Invoke_QA_Bot_without_images": {
"type": "Http",
"inputs": {
"authentication": {
"audience": "[parameters('botAudience')]",
"identity": "[parameters('botIdentityResourceId')]",
"type": "ManagedServiceIdentity"
},
"body": "@body('convertActivity')",
"headers": {
"Content-Type": "application/json"
},
"method": "POST",
"retryPolicy": {
"type": "none"
},
"uri": "[concat(parameters('botBaseUrl'), '/api/messages')]"
},
"runAfter": {},
"runtimeConfiguration": {
"secureData": {
"properties": [
"inputs"
]
}
}
}
}
}
Expand Down
Loading
Loading