我们在 Azure DevOps 上运行的管道在运行 Azure CLI 命令时突然失败:
az functionapp config set name "appname" --resource-group "groupname" --slot "slot" --net-framework-version v7.0
它产生的错误是
无效版本:对于运行时 dotnet-isolated 和操作系统窗口。运行时 dotnet-isolated 和操作系统窗口支持的版本为:['.4.8', '8', '7', '6']。运行“az functionapp list-runtimes”以获取有关支持的运行时的更多详细信息。
我们的 azure 函数是在 .NET Core 7.0 上运行的版本 4
有人知道为什么突然发出这个警告吗?我尝试过使用 v7、7.0 和 7,它们都会产生相同的警告。
我们的 Azure CLI 版本是 2.57.0。我检查了它的发布版本页面,我没有看到任何关于 .NET 框架值被更改的内容。
之前我设置了函数
.NET Version to 7 Isolated
,现在我通过Azure DevOps管道.NET 8 Isolated
任务将其设置为Azure CLI
,如下所示:-
Azure CLI 任务:-
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: AzureCLI@2
inputs:
azureSubscription: 'xxx subscription (xxxx5-f598-xx6xxxx-xxxxa7)'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: 'az functionapp config set --name "valleyfunc765" --resource-group "silconrg62" --net-framework-version 8'
输出:-
.NET 8 Isolated
更新成功:-
.NET 8 Isolated
已成功更新,参考如下:-
警告消息出现在
Devops console
中,但您可以忽略此警告,因为它看起来像是 AzureCLI@2
Devops 任务的暂时性问题,当我在我的应用程序中运行相同的命令时,没有弹出相同的警告。本地命令提示符:-
Devops 警告,但代码仍然成功运行:-
警告:无效版本:对于运行时 dotnet-isolated 和操作系统窗口。运行时 dotnet-isolated 和操作系统窗口支持的版本为:['.4.8', '8', '7', '6']。运行“az functionapp list-runtimes”以获取有关支持的运行时的更多详细信息。
本地命令提示符输出:-
命令:-
az functionapp config set --name "siliconnet7iso" --resource-group "siliconRG" --net-framework-version 8
我还运行了一个命令来列出所有运行时,它还显示了 .NET 版本 - 7 和隔离在列表中:-
命令:-
az functionapp list-runtimes --os windows
输出:-
参考资料:-