is there a way to get the sku for a list of web apps using az cli ?

Mario Alessio Caruso 21 Reputation points
2021-02-23T23:17:49.977+00:00

I have a list of web apps, resourcegroup I would liketo be able to query each webapp for the sku used (F1,B1 etc) is there a way to do this ? tnx M.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,249 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ryan Hill 26,866 Reputation points Microsoft Employee
    2021-02-24T05:44:16.417+00:00

    Hi @Mario Alessio Caruso ,

    Unfortunately, no there isn't a direct way. The SKU is tied to the app service plan and since it returns Microsoft.Web/serverfarms, there isn't any relevant data about what apps are associated to that plan.

    If you want to go to the CLI route, you'll have to create a script that returns what you need into a variable e.g. $plans = az appservice plan list --resource-group myresourcegroup --query "[].{Id:id, Name:name, Sku:sku.name}" --output table To get your list of app service plans. Next you'll need iterate of over $plans passing id as parameter for query e.g. az webapp list --resource-group myresourcegroup --query "[?appServicePlanId=='<<$plan.id>>']

    Regards,
    Ryan


0 additional answers

Sort by: Most helpful