0

I created a new app service on my Azure account. When I created the app service I choose that I want it to run Python 3.9 (The newest version possible). I enter the configuration menu on my app service and I saw it run Python 3.9 I created my app and now I want to deploy it to the Azure app service, but when I enter to azure kudu command line, I enter the BASH command line typed "python -V" I get "Python 2.7.16" and python3 -V I get "Python 3.7.3"

The problem Is I developed my app on my mac which is Python "3.9.12". Should I downgrade the python on my Mac?

How do I do this?

Thank you, Tal

Tal_87_il
  • 29
  • 1
  • 7
  • 1
    Does this answer your question? [Why python is still version 2.7 after I've installed a python version 3.6 in my Azure App Service?](https://stackoverflow.com/questions/68298694/why-python-is-still-version-2-7-after-ive-installed-a-python-version-3-6-in-my) – Ecstasy Aug 17 '22 at 09:24
  • Are these helpful? [Azure App Service with Python 3.9 deployment failed](https://stackoverflow.com/questions/71780463/azure-app-service-with-python-3-9-deployment-failed) and [Azure webapp: How to update Python version?](https://stackoverflow.com/questions/71473389/azure-webapp-how-to-update-python-version) – Ecstasy Aug 17 '22 at 09:29

1 Answers1

0
  • I have created python 3.9.12 and deployed to azure from VS Code MAC OS
  • Even I am getting the Python version as 2.7.16 in Bash.

enter image description here

  • If I check the version in Azure CLI, got the latest 3.9 version by using the below command.

enter image description here

az webapp config show --resource-group YourRGName --name YourWebAppName --query linuxFxVersion
  • The version which I got with Azure CLI command is the exact version which my Azure App Service is using.

  • We can change the python version in Azure portal.

  • For Windows app service there is an Extensions option, but for Linux app service it is disabled. enter image description here

  • For Linux app service run the below command to update the version from Azure CLI

az webapp config set --resource-group YourRGName --name YourWebAppName --linux-fx-version "PYTHON|3.9"

Should I downgrade the python on my Mac?

If you can use the older version, you can downgrade your python version. If you want to use only the latest version, then update the python version in Azure Web App in Portal which I have mentioned in previous steps.

Harshitha
  • 3,784
  • 2
  • 4
  • 9
  • Go to Kudu -> SSH and then check the Python Version. It should show Python 3.x. (Kudu->Bash goes to the Kudu Container, which may have a different version) – Gaurav Kumar Sep 12 '22 at 05:48