Azure函数投掷例外,以修改Dashborad上的Azure自定义字段

发布于 2025-02-01 09:47:04 字数 2328 浏览 3 评论 0原文

我创建了一个功能来自动从Azure板任务计算自定义日志小时。我正在关注下面的链接:

https://tfsaggregator.github.github.io/docs/docs/docs/v3/ < /a>

使用上述其他一些开发人员成功实现的链接,但是1年后,PAT到期并起作用,完全停止了功能。现在,我再次遵循相同的步骤执行它,并使用新PAT添加了新规则。但是,当我更改日志小时时,我得到了以下例外,我不明白:

2022-05-24 13:30:55.026
Executing 'Functions.AutoCal' (Reason='This function was programmatically called via the host APIs.', Id=4650-4f75-9324-5823890a50b7)
Information
2022-05-24 13:30:55.161
Error
2022-05-24 13:30:55.161
Function compilation error
Error
2022-05-24 13:30:55.225
run.csx(14,23): error CS1705: Assembly 'aggregator-function' with identity 'aggregator-function, Version=1.2.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' which has a higher version than referenced assembly 'Microsoft.Extensions.Logging.Abstractions' with identity 'Microsoft.Extensions.Logging.Abstractions, Version=3.1.23.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
Error
2022-05-24 13:30:55.297
run.csx(15,27): error CS1705: Assembly 'aggregator-webshared' with identity 'aggregator-webshared, Version=1.2.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' which has a higher version than referenced assembly 'Microsoft.Extensions.Logging.Abstractions' with identity 'Microsoft.Extensions.Logging.Abstractions, Version=3.1.23.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
Error
2022-05-24 13:30:55.297
run.csx(16,24): warning CS1701: Assuming assembly reference 'Microsoft.AspNetCore.Mvc.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' used by 'aggregator-function' matches identity 'Microsoft.AspNetCore.Mvc.Abstractions, Version=3.1.23.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' of 'Microsoft.AspNetCore.Mvc.Abstractions', you may need to supply runtime policy
Warning
2022-05-24 13:30:55.367
Script compilation failed.
Error
2022-05-24 13:30:55.367
Executed 'Functions.AutoCal' (Failed, Id=4650-4f75-9324-5823890a50b7, Duration=358ms)
Error
2022-05-24 13:30:55.371
Script compilation failed.

I created a function to auto calculate custom log hour from Azure board task. I'm following the link below:

https://tfsaggregator.github.io/docs/v3/

Using the above link some other developer achieve successfully but after 1 years PAT expired and function working completely stopped. Now I again followed the same steps to execute it and I added new rule using new PAT. But while I'm changing log hours I've got the following exception which I do not understand:

2022-05-24 13:30:55.026
Executing 'Functions.AutoCal' (Reason='This function was programmatically called via the host APIs.', Id=4650-4f75-9324-5823890a50b7)
Information
2022-05-24 13:30:55.161
Error
2022-05-24 13:30:55.161
Function compilation error
Error
2022-05-24 13:30:55.225
run.csx(14,23): error CS1705: Assembly 'aggregator-function' with identity 'aggregator-function, Version=1.2.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' which has a higher version than referenced assembly 'Microsoft.Extensions.Logging.Abstractions' with identity 'Microsoft.Extensions.Logging.Abstractions, Version=3.1.23.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
Error
2022-05-24 13:30:55.297
run.csx(15,27): error CS1705: Assembly 'aggregator-webshared' with identity 'aggregator-webshared, Version=1.2.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' which has a higher version than referenced assembly 'Microsoft.Extensions.Logging.Abstractions' with identity 'Microsoft.Extensions.Logging.Abstractions, Version=3.1.23.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
Error
2022-05-24 13:30:55.297
run.csx(16,24): warning CS1701: Assuming assembly reference 'Microsoft.AspNetCore.Mvc.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' used by 'aggregator-function' matches identity 'Microsoft.AspNetCore.Mvc.Abstractions, Version=3.1.23.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' of 'Microsoft.AspNetCore.Mvc.Abstractions', you may need to supply runtime policy
Warning
2022-05-24 13:30:55.367
Script compilation failed.
Error
2022-05-24 13:30:55.367
Executed 'Functions.AutoCal' (Failed, Id=4650-4f75-9324-5823890a50b7, Duration=358ms)
Error
2022-05-24 13:30:55.371
Script compilation failed.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

卷耳 2025-02-08 09:47:04

我解决了问题。我们需要如下,

DotNet运行时版本3.1或从聚合文档推荐。
最新版本的聚合器EXE。

注意:.rule文件在JavaScript中,因此不会受到上述版本更改的影响。因此,请务必使用最新版本的聚合器并推荐DotNet运行时版本。

最好的替代解决方案是Microsoft Flow,
https:// www .dombat.co.uk/using-microsoft-flow-to-fill-calculated-fields-in-azure-devops/

上面的解决方案提供计算的值,而无需刷新页面。

I resolved my issue. We need as follows,

Dotnet runtime version 3.1 or recommended from Aggregator documentation.
The latest version of Aggregator exe.

Note: .rule file is in the javascript, so it will not get impacted by any above version changes. So always use the latest version of Aggregator and recommended dotnet runtime version.

Best alternative solution is Microsoft flow,
https://www.dombat.co.uk/using-microsoft-flow-to-fill-calculated-fields-in-azure-devops/

https://www.youtube.com/watch?v=SK86TLZQw9A

Above solution provide calculated value without refreshing page.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文