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

标签 python azure azure-web-app-service

我正在 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/

相关文章:

python - 在 python selenium 中切换窗口时出错

python - 如果两个字典的值/键对匹配,则用另一个字典的值替换列表对象字典值

c# - 每次调用或存储在静态变量中时读取环境变量吗?

json - 如何通过 ARM 模板在应用程序网关中创建 backendAddressPools、frontendports 的多个实例

python - DP求解0和1个数相等的连续子数组的最大长度

ios - Azure 移动服务 - 推送通知注册不起作用 [ios]

azure - 连续的 Azure Web 作业在交换到新插槽后是否会重新启动?

asp.net - 在 Azure 网站上设置 URL 重写的 header - AppCmd 或 applicationhost.config?

azure - AKV10032 : Invalid issuer error when connecting to Azure Key Vault from App Service

python - 使用 Python 将 CSV 转换为二进制