英文:
Enqueueing a message to Azure Storage in an Azure function without changing the output
问题
我有一个用Go编写的自定义处理程序,作为Azure函数运行。它有一个具有两种方法的端点:
- POST /entities
- PUT /entities
让我的应用程序作为Azure函数运行很容易:我在host.json
中添加了"enableForwardingHttpRequest": true
,然后它就可以工作了。
**我需要实现的目标:**由于一些原因,现在我需要在实体更改时将消息加入队列,以触发另一个函数,该函数使用queueTrigger
执行一些异步操作。
**我尝试过的方法:**到目前为止,我找到的唯一方法是禁用enableForwardingHttpRequest
,并更改所有端点以接受Azure函数的原始JSON输入和输出,然后在其中一个字段中输出一条消息(如此处所述)。
这听起来像是为了实现简单的事情而进行了巨大的改变...有没有一种方法可以在不改变应用程序处理请求的方式的情况下将消息加入队列?
英文:
I have a custom handler written in Go running as an Azure Function. It has an endpoint with two methods:
- POST /entities
- PUT /entities
It was easy to make my application run as an Azure function: I added "enableForwardingHttpRequest": true
to host.json
, and it just works.
What I need to achieve: life happened and now I need to enqueue a message when my entities change, so it will trigger another function that uses a queueTrigger
to perform some async stuff.
What I tried: The only way I found so far was to disable enableForwardingHttpRequest
, and change all my endpoints to accept the Azure Function's raw JSON input and output, and then output a message in one of the fields (as documented here.
It sounds like a huge change to perform something simple... Is there a way I can enqueue a message without having to change all the way my application handles requests?
答案1
得分: 1
根据这个Github文档,目前Azure函数中与Go语言相关的自定义处理程序存在一个bug,需要修复。
英文:
As per this Github document as of now custom handlers related to go lang in Azure functions having a bug and which need to be fixed.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论