【问题标题】:How to make C# Azure Function work with Static Web App?如何使 C# Azure Function 与静态 Web 应用程序一起使用?
【发布时间】:2020-08-17 03:22:06
【问题描述】:

我按照page 上的说明创建了一个静态 Web 应用程序。 Javsscript Azure 函数有效。

然后我用 C# 版本替换了 API。现在,当我将函数发布到 Azure 时,出现以下错误。

The function language 'dotnet' is unsupported or invalid. The following languages are valid: node.

这是因为 Azure Static WebApp 不支持 dotnet/C# 吗?如果 Static Web App 支持,我如何在 C# 中使用它?

【问题讨论】:

标签: azure-functions azure-static-web-app


【解决方案1】:

不支持 C# 中的 API Functions 应用。

Azure 静态 Web 应用通过 Azure Functions 提供 API。 Azure Functions 的功能集中在一组特定的功能上,这些功能使你能够为 Web 应用程序创建 API,并允许 Web 应用程序安全地连接到 API。并且 API Functions 应用程序必须使用 JavaScript。

看看这个:

https://docs.microsoft.com/en-us/azure/static-web-apps/apis#constraints

【讨论】:

  • 在撰写本文时,docs.microsoft.com/en-us/azure/static-web-apps/apis#constraints 声明“API 必须是 JavaScript、C# 或 Python Azure Functions 应用程序。”我无法让它工作。
  • 我有一个静态 Web 应用程序,使用 c# Azure 函数作为 api。如果您可以在 GitHub 上分享您的代码,我可能会为您提供帮助。
猜你喜欢
  • 2021-05-14
  • 2020-12-27
  • 2021-11-16
  • 2016-01-21
  • 1970-01-01
  • 1970-01-01
  • 2016-08-02
  • 2013-08-06
  • 2022-12-08
相关资源
最近更新 更多