question

akammerer avatar image
3 Votes"
akammerer asked TanMajorvin-6488 answered

Azure Functions always using Python 3.6

Hi,

starting today, we are experiencing a strange issue with our Azure Functions configured to run on Python 3.7.

I have a Function App configured to run on a dedicated App Service Plan for Linux. This Function App is configured to run on Python 3.7 (I even checked in the resource configuration). We have deployed our code using the Run From Package method and therefore pre-compile the requirements ourselves with Python 3.7.

For some reason, irregardless of the configured runtime version for the function, our functions will be started using Python 3.6. Whenever I run a function inside my Function App, the actual python code will get executed using Python 3.6. This leads to all kind of issues since we compile our packages using 3.7.

The first step I tried was to use the remote build option to deploy my function. I tried the following:

func azure functionapp publish my-awesome-function --build remote

What then happens is that Oryx will try to build my app but again uses Python 3.6 to do so. It even warns me that I am using an outdated version:

Warning: An outdated version of python was detected (3.6.10). Consider updating.\nVersions supported by Oryx: https://github.com/microsoft/Oryx


What I have also tried was:

  • If I now go to "Configuration" in the Function App blade on the Azure Portal, my Stack Settings (under General settings) are Python and Python 3.7. I'd assume these coincide with the version of Python that the Function App should use.

  • I created a new Function App and specified Python 3.7 as the runtime version during the creation. I had the same problem again.

Is this a problem with the platform right now? Am I doing something wrong?

Thank you for your help

Alexander



azure-webappsazure-functions
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Not that it helps, but I can confirm your issue. Creating Function App from ARM template and from Portal configured to use Python 3.7. However, when using ssh to connect to container I can see that I am still running 3.6.1

0 Votes 0 ·

@AlexanderKammerer-3296, @bjoern can you both email us at AzCommunity[at]microsoft[dot]com ATTN Ryan including your subscription id and function app names so we can more closely assist you? Which regions are you deploying to?

2 Votes 2 ·

Thanks for the answer! I am deploying to West Europe. I have emailed you the subscription id.

0 Votes 0 ·

Send you subscription id and function app name. Also deploying to West Europe here.

0 Votes 0 ·

Same problem here, using python 3.8 and deploying to West Europe. On a consumption plan it works fine, but on a dedicated plan it runs 3.6. Setting the correct version through Azure Cloud shell did not help either. We already deleted the function using that plan, but I can recreate it very quickly. Could we get the same assistance ?

0 Votes 0 ·
akammerer avatar image
0 Votes"
akammerer answered DuurenElpeevan-3502 commented

The problem has gotten even worse to the point that I am no longer able to deploy any Function App running Python on the Consumption Plan. I have just created a completely new Function App and deployed via the function tools from VS Code.

At the end of the deployment, it will fail to sync triggers, fail to retrieve the remote build status and report a 500 Internal Server Error.

What happens next is that the Portal bugs completely out. I am no longer able to see any kind of configuration settings for this Function App nor can I access any deployment logs via the SCM site. (This will not load for me.)

Basic functions of the Azure CLI will fail to work (such as retrieving the configuration for this function app) and tell you that error 500 happened.

What is going on?

· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Any updates yet ?

0 Votes 0 ·

As for the dead Function Apps: no update yet. I have a support ticket open that is being worked on. Let's see what Monday brings.

The other problem about the deployment can be fixed by adjusting the LinuxFxVersion in the function app configuration. You need to set it to "DOCKER|mcr.microsoft.com/azure-functions/python:2.0.13351-python3.7-appservice". This will allow you to deploy your apps again while they work on the problem.

This can be done using Azure CLI (https://docs.microsoft.com/en-us/cli/azure/functionapp/config?view=azure-cli-latest#az-functionapp-config-set).

az functionapp config set -n yourfunctionapp -g yourresourcegroup --linux-fx-version "DOCKER|mcr.microsoft.com/azure-functions/python:2.0.13351-python3.7-appservice"

0 Votes 0 ·

So you are running your function not as code but in a docker container to work around the python version issue ? I tried fixing the python version through the Azure Cloud Shell, but I see I might have made a mistake in the command. Thanks for the update !

0 Votes 0 ·
Show more comments
ryanchill avatar image
2 Votes"
ryanchill answered

Apologies to all for this impact.


I do want all in this thread to know that this issue has been mitigated and a fix is pending rollout. Should be complete by the end of this week. I would suggest in the interim, to those affect, please see @AlexanderKammerer-3296 workaround for setting LinuxFxVersion to python:2.0.13351-python3.7-appservice.


Regards,
Ryan


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SebastianLehmann-2508 avatar image
0 Votes"
SebastianLehmann-2508 answered SebastianLehmann-2508 published

Thanks for the confirmation of this issue. It seems oryx is always using the parameter "--platform-version 3.6"

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TanMajorvin-6488 avatar image
0 Votes"
TanMajorvin-6488 answered

I have a similar issue where I'm using mcr.microsoft.com/azure-functions/python:3.0-python3.8-appservice but shell says I use 3.6. Based on this github issue, using docker is out of date, so I'm not sure if its deprecated or not working anymore

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.