[英]How can I add regex in a variable value in azure function bindings file?
I have an azure function and I want to trigger it when a new blob is detected.我有一个 azure function,我想在检测到新 blob 时触发它。 Current bindings in
functions.json
: functions.json
中的当前绑定:
"bindings": [
{
"name": "myblob",
"type": "blobTrigger",
"direction": "in",
"path": "cfimages/{name}.png",
"connection": "ImageStorageEndpoint"
},
It works well and is triggered with "test_image.png"它运作良好并由“test_image.png”触发
Now, I want to trigger it with aa certain file name (with a certain suffix) and I wrote this:现在,我想用某个文件名(带有某个后缀)触发它,我这样写:
"bindings": [
{
"name": "myblob",
"type": "blobTrigger",
"direction": "in",
"path": "cfimages/_?topview.png",
"connection": "ImageStorageEndpoint"
},
I dont get an error but I cant trigger it using a file "test_topview.png".我没有收到错误,但我无法使用文件“test_topview.png”触发它。 Can someone help me with the issue?
有人可以帮我解决这个问题吗?
Azure trigger bindings: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-expressions-patterns Azure 触发器绑定: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-expressions-patterns
Thank you.谢谢你。
To achieve the above requirement You may need to Pass the file name path as below in your azure function binding.要实现上述要求,您可能需要在 azure function 绑定中传递如下文件名路径。
Example Code for trigger file name:-触发器文件名的示例代码:-
{
"bindings": [
{
"name": "image",
"type": "blobTrigger",
"path": "sample-images/{filename}",//
"direction": "in",
"connection": "MyStorageConnection"
},
For more information please refer the below links:有关更多信息,请参阅以下链接:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.