azureazure-web-app-serviceazure-powershell

How to read the name of the App Service Plan used an App Service with Azure Powershell


Given the name of an Azure App Service, I want to be able to find the name of the App Service plan. I've inspected the object returned by Get-WebApp but it doesn't contain any reference to the App Service Plan used.


Solution

  • you can use this bit:

    Get-AzWebApp | Select-Object name, serverfarmid
    

    this will return Web App name and the Service Plan Id.

    ( Get-AzWebApp | Select-Object -ExpandProperty ServerFarmId ) -split '/' | Select-Object -Last 1