Azure函数blob触发器-对不同的主机名和函数的新版本使用相同的收据 [英] Azure functions blob trigger - Use same receipts for different host names and new versions of the function

查看:84
本文介绍了Azure函数blob触发器-对不同的主机名和函数的新版本使用相同的收据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将azure函数与blob触发器以及运行时2.x​​一起使用。执行完函数后,运行时将Blob接收添加到以下位置(azure-webjob-hosts> blobreceipt>)

I am using azure functions with the blob trigger and with the runtime 2.x. After the function being executed the runtime adds blob receipt into the location below (azure-webjob-hosts>blobreceipt>)

是否有任何方法可以使运行时在路径中使用相同的主机名(在本例中为8a76f42c1c01-2137340777)?因为如果在本地运行函数或发布新版本的代码,它将使用不同的主机标识符(例如macbook-id)。

Is there any way to make runtime to use the same hostnameid in the path (in this case it's 8a76f42c1c01-2137340777)? Because if run function locally or publish new version of the code it would use different host identifier (like macbook-id).

主要问题是当我运行 func azure functionapp发布,即使新版本具有相同的功能名称,它也会使用新版本的代码重新排队所有现有的blob,因为它将使用不同的主机/功能标识符来检查收据

The main problem is when I run func azure functionapp publish it will requeue all the existing blobs with new version of the code even when the new version has the same func name because it will use different host/func identifier to check for receipts.

我知道在运行时v1中,您可以将 id 添加到host.json中。我在运行时v2中没有看到这样的选项。

I know that in runtime v1 you could add id into host.json. I dont see such option in runtime v2.

编辑:

另一件事。就在今天早上,我发现我的函数再次遍历了所有Blob。当我查看blobreceipts时,我发现主机ID已更改,并且新主机ID出现了新的收据。即使我没有进行任何部署,主机ID也已更改。那怎么可能?我还报告了coretools上关于hostid在发布时更改的错误。 https://github.com/Azure/azure-functions-core- tools / issues / 1012

Another thing. Just this morning I found out that my function run over all the blobs again. When I looked into blobreceipts I see that the hostid has changed and there are new bunch of receipts for the new host id. Host Id has changed even though I didnt do any deployments. How is that possible? I have also reported the bug on coretools about hostid getting changed on publish. https://github.com/Azure/azure-functions-core-tools/issues/1012

应用程序名称为 altamente-prod-svc-shopify-background 。但是主机ID是 d7031c9b43fc-2137340777 。我现在已经删除了所有收据以进行更多测试,但是您可以在日志中看到该功能是今天早上再次在我的所有7个Blob上再次启动的。目前只有一个功能(还有自动出现的WarmUp功能)。我已经通过Azure门户创建了没有功能的linux func应用程序,然后才使用Mac中的核心工具进行发布。

App name is altamente-prod-svc-shopify-background. But the host id is d7031c9b43fc-2137340777. I have removed all receipts to do more tests for now but you can see in logs that the func was initiated again this morning by itself over all my 7 blobs. There is just one function for now (and also WarmUp func which appeared automatically). I have created the linux func app via Azure portal with no functions and then just did publish with core tools from my mac.

推荐答案

Azure函数错误报告中现在有一种解决方法,您链接到。基本上,在应用程序设置中将 AzureFunctionsWebHost:hostid 设置为一些显式值。我正在使用自托管函数运行时,并且 Kubernetes不允许在环境变量中使用冒号,因此我改用设置 AzureFunctionsWebHost__hostid 的变通办法,该方法也有效。

There is a workaround now in the Azure Functions bug report that you linked to. Basically, set AzureFunctionsWebHost:hostid in the App settings to some explicit value. I'm using a self-hosted functions runtime and Kubernetes doesn't allow colons in environment variables, so I used the work-around of setting AzureFunctionsWebHost__hostid instead, which also works.

这篇关于Azure函数blob触发器-对不同的主机名和函数的新版本使用相同的收据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆