question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az webapp list is showing null values for siteConfig

See original GitHub issue

I want to get list of all webapps where healhCheckPath is not nult. I tried az webapp list --query "[?not_null(siteConfig.healthCheckPath)].{Name:name, ResourceGroup:resourceGroup}" and az webapp list --query "[?siteConfig.healthCheckPath!=null].{Name:name, ResourceGroup:resourceGroup}" but the cli was returning empty array. I then ran the command az webapp list --query "[?name=='web_app_where_health_check_is_enabled']" and this returns one record but heathCheckPath was null but in reality health check is enabled for this specific app. Later I tried az webapp show -g <resource-group> -n <name> and this showed me the value for healthCheckPath. So the issue is with the list command. I can’t use webapp show command because I want to fetch all the webapps which meet specific conditions.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
PramodValavala-MSFTcommented, Mar 8, 2022

@junaidahmed92 This seems to be by design with an extra REST API call required to get the configuration for a web app, which the CLI is performing when running az webapp show. Here is a workaround you can use instead.

Bash

az webapp list --query '[].id' -o tsv | xargs | xargs -I{} bash -c "az webapp show --ids {} --query '[?not_null(siteConfig.healthCheckPath)].{Name:name,ResourceGroup:resourceGroup}'"

PowerShell

(az webapp list --query '[].id' -o tsv) -Join (" ") | %{Invoke-Expression "az webapp show --ids $($_) --query '`"[?not_null(siteConfig.healthCheckPath)].{Name:name,ResourceGroup:resourceGroup}`"'"}
1reaction
PramodValavala-MSFTcommented, Mar 8, 2022

@junaidahmed92 Looks like this is a limitation of the underlying REST API (Web Apps - List) where it doesn’t include siteConfig data. I will check with the concerning team for more insights.

Read more comments on GitHub >

github_iconTop Results From Across the Web

az webapp list is showing null values for siteConfig
I tried az webapp list --query "[?not_null(siteConfig.healthCheckPath)].{Name:name, ResourceGroup:resourceGroup}" but the cli was returning ...
Read more >
Get correct property values in Azure Resource Graph Explorer
I am trying to get the list of resources with . ... Web/sites" I am getting "null" values everywhere. ... azure-webapps. Comment. Comment...
Read more >
azure-cli 2.23.0 - PyPI
New command az network express-route peering connection list . (#17450) ... Fix #17053: az webapp show return null values for SiteConfig properties (#17054)....
Read more >
PowerShell $Script:info["VARIABLE"] > Cannot index into a ...
[Solved]-PowerShell $Script:info["VARIABLE"] > Cannot index into a null array-powershell ... az webapp list is showing null values for siteConfig ...
Read more >
Deploying an Azure Web App with Bicep - Robert Chambers
Unlike when resources are deployed into a resource group using the az deployment group command, we'll instead use the az deployment sub command ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found