Support for PowerShell 7.0 in Azure Functions is ending on 3 December 2022

Support for PowerShell 7.0 in Azure Functions is ending on 3 December 2022. This post explains how to use PowerShell to find affected functions in your environment.

If you use PowerShell 7.0 in Azure Functions you should have recently received an “Action required” message like this:

Support for PowerShell 7.0 in Azure Functions is ending on 3 December 2022

You’re receiving this email because you use PowerShell 7.0 in Azure Functions.

On 3 December 2022, support for PowerShell 7.0 in Azure Functions will end. Your existing workloads and apps that are hosted on Functions will continue to run, but we’ll no longer provide updates or customer service for PowerShell 7.0. To ensure that your Functions apps are fully supported, you’ll need to upgrade them to PowerShell 7.2 by that date.

If you have a lot of functions, possibly running a lot of different runtimes and/or PowerShell versions it could be tricky to find what needs upgrading as the email does not specify the functions. Once again PowerShell comes to the rescue!

First up, authenticate to your Azure Account as normal with Connect-AzAccount

Then this PowerShell will list all the PowerShell Function Apps in the current subscription along with the PowerShell version. It’s fairly self explanatory, but to summarise the snippet Gets all the Function Apps Where the runtime is PowerShell and shows you (Selects) the name of the Function App, the name of the Resource Group it is in, the Status (Running, Stopped), and the current PowerShell version it is using.

1Get-AzFunctionApp | 
2    Where-Object {$_.Runtime -eq "PowerShell"} | 
3    Select-Object Name, 
4                  ResourceGroupName, 
5                  Status, 
6                  @{N="PowerShellVersion";E={$_.SiteConfig.PowerShellVersion}}

To only list Functions which are using pre-7.2 versions of PowerShell we can add a further Where-Object filter as follows:

1Get-AzFunctionApp | 
2    Where-Object {$_.Runtime -eq "PowerShell"} | 
3    Select-Object Name, 
4                  ResourceGroupName, 
5                  Status, 
6                  @{N="PowerShellVersion";E={$_.SiteConfig.PowerShellVersion}} |
7    Where-Object {$_.PowerShellVersion -lt 7.2}

If you want to check other Subscriptions, you can use the Set-AzContext cmdlet to switch subscription and then run the above snippet again.