【问题标题】:Azure functions CLI latest templatesAzure 函数 CLI 最新模板
【发布时间】:2022-11-09 15:19:36
【问题描述】:

我想创建一个新的 Azure 函数,它使用模板来支持 OpenApi,如 here 所述

由于我使用的是 Mac 而不是 Windows,因此我想知道如何从 CLI 或 VS Code 中获取最新的模板。

我试过了

func new --template "Http Trigger with OpenAPI" --name MyHttpTrigger

但这给了

Unknown template 'HttpTriggerwithOpenAPI' (Parameter 'templateName')

【问题讨论】:

    标签: visual-studio visual-studio-code azure-functions azure-functions-core-tools


    【解决方案1】:

    AFAIK, 在使用 cmdlet func new ... 创建 Azure 函数之前,请检查所需模板是否在您要创建的语言(堆栈)中可用。

    1. func templates list - 运行此 cmdlet 以查看根据您正在创建的特定语言运行时(C#、JavaScript)的可用模板。

      如果模板可用,则可以使用 func new cmdlet 在 Azure Functions 项目上创建该模板。

      有关详细信息,请参阅func new cmdlet MS Doc。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多