15 April, 2025

How to find Azure Functions running Python 3.9

Going through my inbox, I see that Azure Functions' support for Python 3.9 ends on 31 October 2025.

This is likely to catch some people out, as in my experience, few teams understand what Python runtimes they're using, and fewer are likely to know what or how to prepare for this.

To find Functions in your environment using Python 3.9, you can use the below Azure Resource Graph query:

resources
| where type == 'microsoft.web/sites'
| extend state = tolower(properties.state)
| where (kind in~ ('functionapp','functionapp,linux','functionapp,linux,container','functionapp,linux,container,kubernetes','functionapp,linux,kubernetes','functionapp,kubernetes','functionapp,linux,container,azurecontainerapps')) and ((type =~ ('microsoft.web/sites')))
| mv-expand properties.siteProperties.properties
| where isnotnull(properties_siteProperties_properties.value) and properties_siteProperties_properties.value != ""
| extend runtime_version=properties_siteProperties_properties.value
| project name,runtime_version,state,kind,location,subscriptionId,resourceGroup,tags
| sort by (tolower(tostring(name))) asc
| where runtime_version =~ "python|3.9"

In the email, Microsoft recommends upgrading your Functions apps to Python 3.11... but this is wrong. You should instead upgrade to Python 3.12.

As many Python devs who use Azure Functions will know, the very old versions of glibc that ship with the Functions runtime have caused issues with the Cryptography module. The Azure Functions team have confirmed that a proper fix for this issue is included in the Python 3.12 runtime.

Tagged: