You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无local.settings.json时,如何在Azure DevOps管道启动dotnet-isolated Azure Function

解决Azure DevOps管道中以dotnet-isolated模式启动Azure Function的问题

方法一:执行func start前设置环境变量

FUNCTIONS_WORKER_RUNTIME本质是环境变量,无需依赖local.settings.json,可以在启动命令前直接配置:

  • Windows命令行任务:
    set FUNCTIONS_WORKER_RUNTIME=dotnet-isolated
    func start
    
  • Bash任务(Linux/macOS代理):
    export FUNCTIONS_WORKER_RUNTIME=dotnet-isolated
    func start
    

方法二:生成临时极简local.settings.json

在管道中创建仅包含必要配置的临时文件,既避免敏感信息提交,又满足启动要求:

  • PowerShell任务示例:
    @'
    {
      "IsEncrypted": false,
      "Values": {
        "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated"
      }
    }
    '@ | Out-File local.settings.json -Encoding utf8
    func start
    
  • Bash任务示例:
    cat > local.settings.json << EOF
    {
      "IsEncrypted": false,
      "Values": {
        "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated"
      }
    }
    EOF
    func start
    

上述两种方法都能让func start识别dotnet-isolated运行时,避免出现Did not find functions with language [dotnet]的错误。

内容的提问来源于stack exchange,提问作者Rob Bowman

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 08:45:25