【问题标题】:Azure WebApp - Unable to auto-detect the runtime stack of your appAzure WebApp - 无法自动检测应用程序的运行时堆栈
【发布时间】:2022-04-04 23:16:01
【问题描述】:

我正在尝试创建仅具有静态 HTML 的 Web 应用程序。我正在关注此链接https://docs.microsoft.com/en-us/azure/app-service/app-service-web-get-started-html。但是当我执行以下命令时

az webapp up --location westeurope --name .

收到错误 - “无法自动检测您应用的运行时堆栈”。

【问题讨论】:

标签: azure azure-web-app-service


【解决方案1】:

我尝试了以下方法,但在 az webapp up 命令末尾添加了 --html 标志以绕过自动检测:

mkdir quickstart
cd quickstart
git clone https://github.com/Azure-Samples/html-docs-hello-world.git
cd html-docs-hello-world
az webapp up --location westeurope --name azurewebapptest123 --html

这会强制使用 HTML。在命令的帮助中,它暗示自动检测适用于多种语言,但不适用于静态 HTML。

【讨论】:

  • 有趣的是,在第一次更新应用程序的部分,命令中包含了 --html 标志。
  • 完全正确。我写了我的答案,然后我看到了你的。你的答案应该是这个问题的解决方案。
【解决方案2】:

我刚刚尝试按照文档中提到的步骤进行操作。对我有用。

mkdir quickstart
cd quickstart
git clone https://github.com/Azure-Samples/html-docs-hello-world.git
cd html-docs-hello-world
az webapp up --location westeurope --name azurewebapptest123

【讨论】:

    【解决方案3】:

    我已经使用示例 repo 尝试了类似的步骤,并且能够重现它。

    这是版本:

    这是 Azure CLI 2.0.78 的一个已知错误,团队正在努力解决,您可以在此处跟踪它:

    https://github.com/MicrosoftDocs/azure-docs/issues/43633

    解决此问题的方法是使用旧版本的 Azure CLi,例如2.0.75 * 用于部署解决方案。

    希望对你有帮助。

    【讨论】:

      【解决方案4】:

      尝试手动包含 web.config 文件和/或在常规设置中选择堆栈:

      如果您没有后端,托管静态站点的最佳选择是通过 Azure 存储:

      https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website

      【讨论】:

      • 是的,幸运的是我的网站没有任何后端。因此通过 Azure 存储作为静态站点托管
      【解决方案5】:

      我遇到了同样的问题。我通过使用标志--html 根据运行时检测的文档明确定义运行时来解决它。 https://github.com/Azure/app-service-linux-docs/blob/master/AzWebAppUP/runtime_detection.md

      所以,解决方案是以下代码行:

      az webapp up --location westeurope --name <name> --html
      

      注意:我使用了 Azure 云外壳。

      【讨论】:

        【解决方案6】:

        确保您从应用程序根目录运行命令“az webapp up --location westeurope --name”,即在“html-docs-hello-world”文件夹中。

        【讨论】:

          【解决方案7】:

          在 az webapp 命令结束时,您已提供运行时堆栈 如果你使用的是 html 页面,那么 --html 你必须给出

          例如:az webapp up --location westeurope --name az204samplewebapphtml1 --html

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2022-01-17
            • 2016-05-15
            • 2017-09-28
            • 1970-01-01
            相关资源
            最近更新 更多