简体   繁体   English

如何在 azure function 绑定文件中的变量值中添加正则表达式?

[英]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.

相关问题 如何将文件添加到 Azurite [Azure 存储模拟器] - How Can I add a file to Azurite [Azure Storage Emulator] 如何使用 Bot Framework Composer V2 传输 Azure Cosmos DB 中变量的字符串值? - how can I transfer the string value of a variable in Azure Cosmos DB using the Bot Framework Composer V2? 如何授权保护Azure Function? - How I can protect Azure Function by authorization? 如何在 Azure Function 的 HttpTrigger 中使用授权属性 - How can I use Authorize attributes in HttpTrigger of Azure Function 如何将 map 变量传递给 Azure Devops 管道作业? - How can I pass map variable to Azure Devops pipeline job? 在将其部署到 Azure 之前,我们如何保护 Azure Function 中的 local.settings.json 文件 - How we can secure the local.settings.json file inside our Azure Function before deploying it to Azure 如何在 azure function 应用程序中终止 orchestrator function - how can I terminate an orchestrator function in azure function app 如何在 azure 地图中添加双向线 - how can i add Bi directional lines in azure maps 在 React Native 中从其他文件更改值后如何导出变量? - How can I export a variable after value changed from other file in react native? 如何为 Azure Function 添加身份验证 - How to add authentication to a Azure Function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM