1

Is there anyway to combine both commands below where it lists all the function app together with the storage account used for it?

This command gets all the function app in the subscription

az functionapp list 

This command gets the storage account used by the function app

az functionapp config appsettings list --name <appname> -g <rg> --query "[].{name:name, value:value}[?name=='AzureWebJobsStorage']" --out table
Fabian Raj
  • 11
  • 3

1 Answers1

0

You have to loop over the results and use the result properties for the getting the configs:

$functionApps = az functionapp list 
$functionAppObjects = $functionApps | ConvertFrom-Json
$functionAppObjects | ForEach-Object -Process {
    Write-Host $_.name
    az functionapp config appsettings list --name $_.name  --resource-group $_.resourceGroup --query "[].{name:name, value:value}[?name=='AzureWebJobsStorage']" --out table
    Write-Host
}
Markus Meyer
  • 101
  • 3