Sukhmeet Sethi
Sukhmeet Sethi

Reputation: 713

List all functions in a Azure location with Azure cli

Context

In my Azure cloud account, I have access to multiple subscriptions and with in each subscription there are multiple resource groups. Each resource group in turn may have multiple functions across different locations.

I can access functions for a given resource group as following: az functionapp list --subscription <subscription_id> -g <group_id> --output table

This gives me a list of functions as : enter image description here

Now I am looking to list functions for only one location at a time. I tried this : az functionapp list --subscription <subscription_id> -g <resource_id> --query "[?location=='West US']" --output table

This works fine but looks bit complex and also for results I have to now append columns to be fetched in query like [].{Name, Location, State ,...} as the result is very verbose with many columns:

Name,Kind,Location,State,RepositorySiteName,UsageState,Enabled,AvailabilityState,Reserved.......

Question

I was wondering if there is an easy way to list all functions (without --query) in a given location with in a resource group. Somehow if we can specify location directly as we can provide resource group by specifying -g.

Upvotes: 0

Views: 3259

Answers (1)

silent
silent

Reputation: 16108

Using --query as you do, is probably already the best and most efficient way. Not really sure what you do not "like" about it.

Of course, you could also list all Functions in your subscription and filter locally, e.g. in something like PowerShell. But that's worse, not better.

Upvotes: 1

Related Questions