3

With Azure Powershell, how do you get a list of all of a Function App's functions and their respective status (status at the function level, not FunctionApp level)?

I can get a list of FunctionApps with

Get-AzFunctionApp -ResourceGroupName my-resource-group-name

which will give me the FunctionApps and it's FunctionApp.Status but cannot then iterate through these FunctionApps to find a list of each of their functions and the status of those functions.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
Fred2020
  • 315
  • 3
  • 14

1 Answers1

5

I could get one half of the answer (will update the answer, if I get the status of function)

$ResourceGroupName = "RGNAME"
$AppName = "FUNCTIONAPPNAME" 

(Get-AzResource -ApiVersion "2022-03-01" -Name $AppName -ResourceGroupName $ResourceGroupName -ResourceType "Microsoft.Web/sites/functions").ResourceName

enter image description here

Update : Getting status also of function

$ResourceGroupName = "RGNAME"
$AppName = "FUNCTIONAPPNAME"
Get-AzResource -ApiVersion "2022-03-01" -Name $AppName -ResourceGroupName $ResourceGroupName -ResourceType "Microsoft.Web/sites/functions/" -ExpandProperties | ConvertTo-Json

Now you get an array of functions. Have a close look at the output. See the green boxes to help you out with the name and status as shown in the reference screenshot

enter image description here

Hope it helps !

Aatif Akhter
  • 2,126
  • 1
  • 25
  • 46
  • Absolutely spot on, I'd never seen that ApiVersion flag, it seems to open up a lot of additional data. Thanks – Fred2020 May 20 '22 at 14:06