0
votes

I am trying to list the type of app service associated with particular subscription using azure cli.

Type of app service:

  1. Web apps
  2. logic apps
  3. Function apps
  4. mobile apps
  5. API apps

So far I have tried to find out the individual command for these. Out of which I could only get

web apps : az webapp list --subscription subscriptionId 
function apps: az functionapp list --subscription subscriptionId
logic apps: az logic workflow list --subscription subscriptionId

I am not sure the above commands include the API apps and mobile apps or it filters.

Any help would be much appreciated.

3
Have you tried to use az webapp list to list mobile and api app?Jim Xu
az webapp list do not list function apps even though they have type : microsoft.Web/sitesuser273181
az web list cannot list function apps. Because it filters, it will exclude the function app resource. For more details, please refer to github.com/Azure/azure-cli/blob/…Jim Xu

3 Answers

0
votes

Yes you are right, API apps and Mobile apps are part of the Appservice which falls under WebApps.

You could use the CLI command or use the REST API

0
votes

You could use az resource list (see documentation) and apply a query filter

az resource list --subscription subscriptionId --query "[?type=='Microsoft.Web/sites' || type=='Microsoft.Logic/workflows']"

You could update the query filter based on your need.

As mentioned by @Sajeetharan, Mobile Apps, API Apps, Web Apps and Function Apps are part of App services (Microsoft.Web/sites)

0
votes

I tried this because with this I can get detailed properties of each app service.

            webItems = self.azure_cli([
                'webapp' , 'list' , 
                '--subscription', subscription_id
            ])

            funcItems = self.azure_cli([
                'functionapp' , 'list' , 
                '--subscription', subscription_id
            ])

            logicItems = self.azure_cli([
                'logic', 'workflow', 'list',
                '--subscription', subscription_id
            ])

            # checking web, logic, function
            appServiceData = [ webItems.data, logicItems.data, funcItems.data]