gpt4 book ai didi

python - Azure网络应用程序: How to update Python version?

转载 作者:行者123 更新时间:2023-12-03 03:40:21 25 4
gpt4 key购买 nike

我正在 Linux 环境中使用带有 Node 堆栈的 Azure webapp 服务,因为这是我的 webapp 主要运行的内容。然而,我的节点 web 应用程序确实执行一个 Python 脚本,该脚本使用需要 Python 版本 3.6 或更高版本的模块,但该 web 应用程序当前具有 Python 版本 3.5。

我的问题是,如何通过 Azure 控制面板或 Azure CLI 将 Python 版本更新/升级到 3.6 或更高版本。我本想尝试通过 Azure 控制面板使用扩展选项卡,但它似乎无法访问(呈灰色),并且我无法与其交互。

如果您需要更多信息,请询问。

提前致谢!

最佳答案

更改 Azure Web 应用服务中的版本

  • Azure 应用服务支持网站扩展,允许您向网站添加功能。
  • 这些可以作为 ARM 模板的一部分、通过 REST API 或直接通过门户安装。
  • 如果您的网站已经启动并运行,则通过网关安装会更容易。
  • 在 Azure 门户中 => 您的应用服务 => 在“开发工具”下 => 选择“扩展”,然后从“应用服务”边栏选项卡中单击“添加”。

enter image description here

  • 向下滚动扩展列表,直到看到 Python Logo ,然后选择您需要的版本。

  • 我们可以看到“确定”按钮呈灰色。

enter image description here

  • 点击“接受法律条款”按钮,然后点击“确定”

enter image description here

enter image description here

  • 然后您可以看到确定按钮可以访问

更新

更改 Azure Linux Web 应用中的版本

我使用 Powershell 命令更改了 Azure Linux Web App 服务中的 python 版本

要获取当前版本,

az webapp config show --resource-group <resource-group-name> --name <app-name> --query linuxFxVersion

要更新现有版本,

az webapp config set --resource-group <resource-group-name> --name <app-name> --linux-fx-version "PYTHON|3.6"

enter image description here

  • 在门户中 => 您的 Web 应用程序 => 配置 => 常规设置可以看到python的更新版本

enter image description here

  • 您使用的 python 3.6 版本已弃用。

关于python - Azure网络应用程序: How to update Python version?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71473389/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com