简体   繁体   English

如何将Azure App Service Python版本从3.9.7更改为3.9.12?

[英]How to change Azure App Service Python version from 3.9.7 to 3.9.12?

I am trying to deploy an application on Azure App Service.我正在尝试在 Azure App Service 上部署一个应用程序。 I have created a deployment with Python 3.9.7 , but my app needs Python 3.9.12 .我已经使用Python 3.9.7创建了一个部署,但我的应用程序需要Python 3.9.12 How do I upgrade python's version?如何升级python的版本?

In Azure App Service > Configuration > General Settings > Python minor version, there is no 3.9.12 available.在Azure App Service > Configuration > General Settings > Python minor version里面没有3.9.12可用。 So I have to upgrade it by SSH. But, I don't understand Linux.所以我必须通过SSH升级它。但是,我不明白Linux。

Can anyone tell me a command to upgrade my python version to 3.9.12 using bash?谁能告诉我使用 bash 将我的 python 版本升级到 3.9.12 的命令?

在此处输入图像描述

Created the Python Web App from the Azure Portal with the version 3.9 and shown as 3.9.7 in the SSH Console.从版本 3.9 的 Azure 门户创建 Python Web 应用程序,并在 SSH 控制台中显示为 3.9.7。

In the Configuration, it shown me only these versions in minor and major dropdown lists:在配置中,它只在次要和主要下拉列表中显示了这些版本:

在此处输入图像描述

Using this Azure CLI cmdlet az webapp config set... , I have set the Python version from 3.9.7 to 3.9.12 but not reflected specifically like 3.9.X in the SSH Console.使用此Azure CLI cmdlet az webapp config set... ,我已将 Python 版本从3.9.7设置为3.9.12 ,但在 SSH 控制台中没有像3.9.X那样具体反映。 It is showing the current python version of that web app with the az webapp config show cmdlet:它使用az webapp config show cmdlet 显示该 web 应用程序的当前 python 版本:

az webapp config set --resource-group HariTestRG --name krishpywebapp101 --linux-fx-version "PYTHON|3.9.12"

在此处输入图像描述在此处输入图像描述

Result :结果

az webapp config show --resource-group HariTestRG --name krishpywebapp101 --query linuxFxVersion

在此处输入图像描述

Using the portal/blessed images(available images) you cannot upgrade your webapp runtime to particular python minor version .使用 portal/blessed images(available images)你不能将你的 webapp runtime 升级到特定的 python 次要版本

Currently available minor python versions that can be deployed from portal are 3.7.12,3.8.12,3.9.7,3.10.4.当前可从门户部署的次要版本 python 为 3.7.12、3.8.12、3.9.7、3.10.4。

If you want to run a particular runtime minor version (python 3.9.12) in your web app it is always recommended to use custom docker image using that you can run the unsupported versions as well as mentioned in this documentation .如果您想在 web 应用程序中运行特定的运行时次要版本(python 3.9.12),始终建议使用自定义 docker 图像,您可以使用该图像运行不受支持的版本以及本文档中提到的版本。

在此处输入图像描述

Here is the reference documentation to create custom docker container on Azure app service which has sample Dockerfile as well.这是在 Azure 应用程序服务上创建自定义 docker 容器的参考文档,该服务也包含样本 Dockerfile。

Refer to this Docker Hub registry for python images and select a particular image based on your requirement.请参阅此Docker 集线器注册表以获取 python 图像和 select 根据您的要求的特定图像。

Note : I have looked at the official docker hub registry for python as well unfortunately we do not have any image that support v3.9.12 we have images for V3.9.15.注意:我已经查看了 python 的官方 docker 集线器注册表,不幸的是我们没有任何支持 v3.9.12 的图像我们有 V3.9.15 的图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM